From 298386095907b306e0819e1791a5b3679d083fde Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 14 Sep 2022 21:16:53 +0000 Subject: [PATCH 1/2] chore: use gapic-generator-typescript v2.17.0 PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- 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 | 292 + .../aiplatform/v1/completion_stats.proto | 48 + .../google/cloud/aiplatform/v1/context.proto | 94 + .../cloud/aiplatform/v1/custom_job.proto | 280 + .../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 | 461 + .../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 | 258 + .../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 | 461 + .../aiplatform/v1/explanation_metadata.proto | 398 + .../google/cloud/aiplatform/v1/feature.proto | 154 + .../v1/feature_monitoring_stats.proto | 86 + .../aiplatform/v1/feature_selector.proto | 44 + .../cloud/aiplatform/v1/featurestore.proto | 129 + .../v1/featurestore_monitoring.proto | 149 + .../v1/featurestore_online_service.proto | 224 + .../aiplatform/v1/featurestore_service.proto | 1226 +++ .../v1/hyperparameter_tuning_job.proto | 110 + .../google/cloud/aiplatform/v1/index.proto | 172 + .../cloud/aiplatform/v1/index_endpoint.proto | 245 + .../v1/index_endpoint_service.proto | 335 + .../cloud/aiplatform/v1/index_service.proto | 335 + .../google/cloud/aiplatform/v1/io.proto | 108 + .../cloud/aiplatform/v1/job_service.proto | 1008 ++ .../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 | 592 ++ .../v1/model_deployment_monitoring_job.proto | 310 + .../aiplatform/v1/model_evaluation.proto | 116 + .../v1/model_evaluation_slice.proto | 71 + .../aiplatform/v1/model_monitoring.proto | 212 + .../cloud/aiplatform/v1/model_service.proto | 662 ++ .../cloud/aiplatform/v1/operation.proto | 52 + .../v1/pipeline_failure_policy.proto | 44 + .../cloud/aiplatform/v1/pipeline_job.proto | 365 + .../aiplatform/v1/pipeline_service.proto | 408 + .../cloud/aiplatform/v1/pipeline_state.proto | 58 + .../aiplatform/v1/prediction_service.proto | 231 + .../cloud/aiplatform/v1/saved_query.proto | 85 + .../instance/image_classification.proto | 43 + .../instance/image_object_detection.proto | 43 + .../predict/instance/image_segmentation.proto | 38 + .../instance/text_classification.proto | 37 + .../predict/instance/text_extraction.proto | 44 + .../predict/instance/text_sentiment.proto | 37 + .../instance/video_action_recognition.proto | 50 + .../instance/video_classification.proto | 50 + .../instance/video_object_tracking.proto | 50 + .../predict/params/image_classification.proto | 38 + .../params/image_object_detection.proto | 38 + .../predict/params/image_segmentation.proto | 35 + .../params/video_action_recognition.proto | 38 + .../predict/params/video_classification.proto | 63 + .../params/video_object_tracking.proto | 42 + .../predict/prediction/classification.proto | 40 + .../prediction/image_object_detection.proto | 50 + .../prediction/image_segmentation.proto | 44 + .../prediction/tabular_classification.proto | 38 + .../prediction/tabular_regression.proto | 38 + .../predict/prediction/text_extraction.proto | 51 + .../predict/prediction/text_sentiment.proto | 36 + .../prediction/video_action_recognition.proto | 53 + .../prediction/video_classification.proto | 66 + .../prediction/video_object_tracking.proto | 81 + .../automl_image_classification.proto | 127 + .../automl_image_object_detection.proto | 119 + .../automl_image_segmentation.proto | 105 + .../definition/automl_tables.proto | 283 + .../automl_text_classification.proto | 36 + .../definition/automl_text_extraction.proto | 36 + .../definition/automl_text_sentiment.proto | 43 + .../automl_video_action_recognition.proto | 61 + .../automl_video_classification.proto | 55 + .../automl_video_object_tracking.proto | 66 + .../export_evaluated_data_items_config.proto | 42 + .../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 | 413 + .../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 | 68 + .../v1/dataset_service.delete_dataset.js | 64 + .../v1/dataset_service.export_data.js | 69 + .../v1/dataset_service.get_annotation_spec.js | 67 + .../v1/dataset_service.get_dataset.js | 65 + .../v1/dataset_service.import_data.js | 70 + .../v1/dataset_service.list_annotations.js | 86 + .../v1/dataset_service.list_data_items.js | 86 + .../v1/dataset_service.list_datasets.js | 99 + .../v1/dataset_service.list_saved_queries.js | 86 + .../v1/dataset_service.update_dataset.js | 71 + .../v1/endpoint_service.create_endpoint.js | 79 + .../v1/endpoint_service.delete_endpoint.js | 64 + .../v1/endpoint_service.deploy_model.js | 84 + .../v1/endpoint_service.get_endpoint.js | 63 + .../v1/endpoint_service.list_endpoints.js | 105 + .../v1/endpoint_service.undeploy_model.js | 79 + .../v1/endpoint_service.update_endpoint.js | 66 + ...ine_serving_service.read_feature_values.js | 77 + ...g_service.streaming_read_feature_values.js | 81 + ...turestore_service.batch_create_features.js | 72 + ...store_service.batch_read_feature_values.js | 111 + ...featurestore_service.create_entity_type.js | 77 + .../v1/featurestore_service.create_feature.js | 78 + ...eaturestore_service.create_featurestore.js | 78 + ...featurestore_service.delete_entity_type.js | 69 + .../v1/featurestore_service.delete_feature.js | 64 + ...eaturestore_service.delete_featurestore.js | 70 + ...turestore_service.export_feature_values.js | 88 + .../featurestore_service.get_entity_type.js | 63 + .../v1/featurestore_service.get_feature.js | 63 + .../featurestore_service.get_featurestore.js | 61 + ...turestore_service.import_feature_values.js | 114 + .../featurestore_service.list_entity_types.js | 112 + .../v1/featurestore_service.list_features.js | 122 + ...featurestore_service.list_featurestores.js | 113 + .../featurestore_service.search_features.js | 132 + ...featurestore_service.update_entity_type.js | 84 + .../v1/featurestore_service.update_feature.js | 78 + ...eaturestore_service.update_featurestore.js | 79 + ..._endpoint_service.create_index_endpoint.js | 68 + ..._endpoint_service.delete_index_endpoint.js | 64 + .../v1/index_endpoint_service.deploy_index.js | 69 + ...dex_endpoint_service.get_index_endpoint.js | 63 + ...x_endpoint_service.list_index_endpoints.js | 98 + ..._endpoint_service.mutate_deployed_index.js | 71 + .../index_endpoint_service.undeploy_index.js | 69 + ..._endpoint_service.update_index_endpoint.js | 66 + .../v1/index_service.create_index.js | 68 + .../v1/index_service.delete_index.js | 64 + .../generated/v1/index_service.get_index.js | 63 + .../v1/index_service.list_indexes.js | 83 + .../v1/index_service.remove_datapoints.js | 67 + .../v1/index_service.update_index.js | 67 + .../v1/index_service.upsert_datapoints.js | 67 + ...job_service.cancel_batch_prediction_job.js | 63 + .../v1/job_service.cancel_custom_job.js | 63 + .../job_service.cancel_data_labeling_job.js | 63 + ...ervice.cancel_hyperparameter_tuning_job.js | 63 + ...job_service.create_batch_prediction_job.js | 67 + .../v1/job_service.create_custom_job.js | 67 + .../job_service.create_data_labeling_job.js | 67 + ...ervice.create_hyperparameter_tuning_job.js | 67 + ....create_model_deployment_monitoring_job.js | 67 + ...job_service.delete_batch_prediction_job.js | 64 + .../v1/job_service.delete_custom_job.js | 64 + .../job_service.delete_data_labeling_job.js | 64 + ...ervice.delete_hyperparameter_tuning_job.js | 64 + ....delete_model_deployment_monitoring_job.js | 64 + .../job_service.get_batch_prediction_job.js | 63 + .../v1/job_service.get_custom_job.js | 63 + .../v1/job_service.get_data_labeling_job.js | 63 + ...b_service.get_hyperparameter_tuning_job.js | 63 + ...ice.get_model_deployment_monitoring_job.js | 63 + .../job_service.list_batch_prediction_jobs.js | 94 + .../v1/job_service.list_custom_jobs.js | 93 + .../v1/job_service.list_data_labeling_jobs.js | 99 + ...service.list_hyperparameter_tuning_jobs.js | 93 + ...e.list_model_deployment_monitoring_jobs.js | 90 + ...e.pause_model_deployment_monitoring_job.js | 63 + ....resume_model_deployment_monitoring_job.js | 63 + ...l_deployment_monitoring_stats_anomalies.js | 103 + ....update_model_deployment_monitoring_job.js | 92 + ...ce.add_context_artifacts_and_executions.js | 77 + .../metadata_service.add_context_children.js | 67 + .../metadata_service.add_execution_events.js | 68 + .../v1/metadata_service.create_artifact.js | 79 + .../v1/metadata_service.create_context.js | 79 + .../v1/metadata_service.create_execution.js | 80 + ...metadata_service.create_metadata_schema.js | 80 + .../metadata_service.create_metadata_store.js | 80 + .../v1/metadata_service.delete_artifact.js | 70 + .../v1/metadata_service.delete_context.js | 75 + .../v1/metadata_service.delete_execution.js | 70 + .../metadata_service.delete_metadata_store.js | 64 + .../v1/metadata_service.get_artifact.js | 63 + .../v1/metadata_service.get_context.js | 63 + .../v1/metadata_service.get_execution.js | 63 + .../metadata_service.get_metadata_schema.js | 63 + .../v1/metadata_service.get_metadata_store.js | 63 + .../v1/metadata_service.list_artifacts.js | 105 + .../v1/metadata_service.list_contexts.js | 108 + .../v1/metadata_service.list_executions.js | 105 + .../metadata_service.list_metadata_schemas.js | 84 + .../metadata_service.list_metadata_stores.js | 80 + .../v1/metadata_service.purge_artifacts.js | 76 + .../v1/metadata_service.purge_contexts.js | 76 + .../v1/metadata_service.purge_executions.js | 76 + ...service.query_artifact_lineage_subgraph.js | 96 + ..._service.query_context_lineage_subgraph.js | 67 + ...vice.query_execution_inputs_and_outputs.js | 64 + .../v1/metadata_service.update_artifact.js | 75 + .../v1/metadata_service.update_context.js | 75 + .../v1/metadata_service.update_execution.js | 75 + ...gration_service.batch_migrate_resources.js | 70 + ...ion_service.search_migratable_resources.js | 90 + ...ce.batch_import_model_evaluation_slices.js | 68 + .../v1/model_service.delete_model.js | 63 + .../v1/model_service.delete_model_version.js | 64 + .../v1/model_service.export_model.js | 69 + .../generated/v1/model_service.get_model.js | 71 + .../v1/model_service.get_model_evaluation.js | 63 + ...odel_service.get_model_evaluation_slice.js | 63 + .../model_service.import_model_evaluation.js | 67 + ...el_service.list_model_evaluation_slices.js | 85 + .../model_service.list_model_evaluations.js | 83 + .../v1/model_service.list_model_versions.js | 89 + .../generated/v1/model_service.list_models.js | 105 + .../v1/model_service.merge_version_aliases.js | 78 + .../v1/model_service.update_model.js | 84 + .../v1/model_service.upload_model.js | 80 + .../pipeline_service.cancel_pipeline_job.js | 63 + ...peline_service.cancel_training_pipeline.js | 63 + .../pipeline_service.create_pipeline_job.js | 75 + ...peline_service.create_training_pipeline.js | 67 + .../pipeline_service.delete_pipeline_job.js | 64 + ...peline_service.delete_training_pipeline.js | 64 + .../v1/pipeline_service.get_pipeline_job.js | 63 + .../pipeline_service.get_training_pipeline.js | 63 + .../v1/pipeline_service.list_pipeline_jobs.js | 126 + ...ipeline_service.list_training_pipelines.js | 95 + .../v1/prediction_service.explain.js | 99 + .../v1/prediction_service.predict.js | 83 + .../v1/prediction_service.raw_predict.js | 77 + ...t_metadata.google.cloud.aiplatform.v1.json | 8899 ++++++++++++++++ ...ist_pool_service.create_specialist_pool.js | 68 + ...ist_pool_service.delete_specialist_pool.js | 69 + ...ialist_pool_service.get_specialist_pool.js | 63 + ...list_pool_service.list_specialist_pools.js | 79 + ...ist_pool_service.update_specialist_pool.js | 67 + ...d_service.batch_create_tensorboard_runs.js | 71 + ...ce.batch_create_tensorboard_time_series.js | 73 + ...batch_read_tensorboard_time_series_data.js | 71 + .../tensorboard_service.create_tensorboard.js | 68 + ...d_service.create_tensorboard_experiment.js | 75 + ...sorboard_service.create_tensorboard_run.js | 76 + ..._service.create_tensorboard_time_series.js | 76 + .../tensorboard_service.delete_tensorboard.js | 64 + ...d_service.delete_tensorboard_experiment.js | 64 + ...sorboard_service.delete_tensorboard_run.js | 64 + ..._service.delete_tensorboard_time_series.js | 64 + ...ice.export_tensorboard_time_series_data.js | 90 + .../v1/tensorboard_service.get_tensorboard.js | 63 + ...oard_service.get_tensorboard_experiment.js | 63 + ...tensorboard_service.get_tensorboard_run.js | 63 + ...ard_service.get_tensorboard_time_series.js | 63 + ...rd_service.list_tensorboard_experiments.js | 93 + ...nsorboard_service.list_tensorboard_runs.js | 93 + ...rd_service.list_tensorboard_time_series.js | 93 + .../tensorboard_service.list_tensorboards.js | 93 + ...oard_service.read_tensorboard_blob_data.js | 69 + ...rvice.read_tensorboard_time_series_data.js | 73 + .../tensorboard_service.update_tensorboard.js | 74 + ...d_service.update_tensorboard_experiment.js | 73 + ...sorboard_service.update_tensorboard_run.js | 73 + ..._service.update_tensorboard_time_series.js | 74 + ...rvice.write_tensorboard_experiment_data.js | 68 + ...oard_service.write_tensorboard_run_data.js | 72 + .../vizier_service.add_trial_measurement.js | 68 + ...ervice.check_trial_early_stopping_state.js | 64 + .../v1/vizier_service.complete_trial.js | 79 + .../v1/vizier_service.create_study.js | 67 + .../v1/vizier_service.create_trial.js | 67 + .../v1/vizier_service.delete_study.js | 62 + .../v1/vizier_service.delete_trial.js | 63 + .../generated/v1/vizier_service.get_study.js | 62 + .../generated/v1/vizier_service.get_trial.js | 63 + .../v1/vizier_service.list_optimal_trials.js | 61 + .../v1/vizier_service.list_studies.js | 74 + .../v1/vizier_service.list_trials.js | 74 + .../v1/vizier_service.lookup_study.js | 67 + .../generated/v1/vizier_service.stop_trial.js | 63 + .../v1/vizier_service.suggest_trials.js | 76 + owl-bot-staging/v1/src/index.ts | 53 + .../v1/src/v1/dataset_service_client.ts | 4297 ++++++++ .../src/v1/dataset_service_client_config.json | 70 + .../v1/src/v1/dataset_service_proto_list.json | 112 + .../v1/src/v1/endpoint_service_client.ts | 3656 +++++++ .../v1/endpoint_service_client_config.json | 54 + .../src/v1/endpoint_service_proto_list.json | 112 + ...turestore_online_serving_service_client.ts | 2898 ++++++ ..._online_serving_service_client_config.json | 34 + ...ore_online_serving_service_proto_list.json | 112 + .../v1/src/v1/featurestore_service_client.ts | 5806 +++++++++++ .../featurestore_service_client_config.json | 106 + .../v1/featurestore_service_proto_list.json | 112 + owl-bot-staging/v1/src/v1/gapic_metadata.json | 2277 ++++ owl-bot-staging/v1/src/v1/index.ts | 33 + .../src/v1/index_endpoint_service_client.ts | 3713 +++++++ .../index_endpoint_service_client_config.json | 58 + .../v1/index_endpoint_service_proto_list.json | 112 + .../v1/src/v1/index_service_client.ts | 3529 +++++++ .../src/v1/index_service_client_config.json | 54 + .../v1/src/v1/index_service_proto_list.json | 112 + .../v1/src/v1/job_service_client.ts | 6087 +++++++++++ .../v1/src/v1/job_service_client_config.json | 138 + .../v1/src/v1/job_service_proto_list.json | 112 + .../v1/src/v1/metadata_service_client.ts | 6412 ++++++++++++ .../v1/metadata_service_client_config.json | 150 + .../src/v1/metadata_service_proto_list.json | 112 + .../v1/src/v1/migration_service_client.ts | 3137 ++++++ .../v1/migration_service_client_config.json | 34 + .../src/v1/migration_service_proto_list.json | 112 + .../v1/src/v1/model_service_client.ts | 4688 +++++++++ .../src/v1/model_service_client_config.json | 86 + .../v1/src/v1/model_service_proto_list.json | 112 + .../v1/src/v1/pipeline_service_client.ts | 4057 ++++++++ .../v1/pipeline_service_client_config.json | 66 + .../src/v1/pipeline_service_proto_list.json | 112 + .../v1/src/v1/prediction_service_client.ts | 3045 ++++++ .../v1/prediction_service_client_config.json | 38 + .../src/v1/prediction_service_proto_list.json | 112 + .../src/v1/specialist_pool_service_client.ts | 3378 ++++++ ...specialist_pool_service_client_config.json | 46 + .../specialist_pool_service_proto_list.json | 112 + .../v1/src/v1/tensorboard_service_client.ts | 5882 +++++++++++ .../v1/tensorboard_service_client_config.json | 138 + .../v1/tensorboard_service_proto_list.json | 112 + .../v1/src/v1/vizier_service_client.ts | 4208 ++++++++ .../src/v1/vizier_service_client_config.json | 86 + .../v1/src/v1/vizier_service_proto_list.json | 112 + .../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 | 4569 ++++++++ .../v1/test/gapic_endpoint_service_v1.ts | 3726 +++++++ ..._featurestore_online_serving_service_v1.ts | 2783 +++++ .../v1/test/gapic_featurestore_service_v1.ts | 5901 +++++++++++ .../test/gapic_index_endpoint_service_v1.ts | 3880 +++++++ .../v1/test/gapic_index_service_v1.ts | 3680 +++++++ .../v1/test/gapic_job_service_v1.ts | 6771 ++++++++++++ .../v1/test/gapic_metadata_service_v1.ts | 7088 +++++++++++++ .../v1/test/gapic_migration_service_v1.ts | 3044 ++++++ .../v1/test/gapic_model_service_v1.ts | 5001 +++++++++ .../v1/test/gapic_pipeline_service_v1.ts | 4091 ++++++++ .../v1/test/gapic_prediction_service_v1.ts | 2888 ++++++ .../test/gapic_specialist_pool_service_v1.ts | 3464 +++++++ .../v1/test/gapic_tensorboard_service_v1.ts | 6677 ++++++++++++ .../v1/test/gapic_vizier_service_v1.ts | 4631 +++++++++ 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 | 79 + .../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 | 314 + .../aiplatform/v1beta1/completion_stats.proto | 48 + .../cloud/aiplatform/v1beta1/context.proto | 94 + .../cloud/aiplatform/v1beta1/custom_job.proto | 280 + .../cloud/aiplatform/v1beta1/data_item.proto | 70 + .../v1beta1/data_labeling_job.proto | 207 + .../cloud/aiplatform/v1beta1/dataset.proto | 144 + .../aiplatform/v1beta1/dataset_service.proto | 461 + .../v1beta1/deployed_index_ref.proto | 42 + .../v1beta1/deployed_model_ref.proto | 42 + .../v1beta1/deployment_resource_pool.proto | 50 + .../deployment_resource_pool_service.proto | 219 + .../aiplatform/v1beta1/encryption_spec.proto | 38 + .../cloud/aiplatform/v1beta1/endpoint.proto | 262 + .../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 | 273 + .../v1beta1/featurestore_service.proto | 1226 +++ .../v1beta1/hyperparameter_tuning_job.proto | 110 + .../cloud/aiplatform/v1beta1/index.proto | 172 + .../aiplatform/v1beta1/index_endpoint.proto | 245 + .../v1beta1/index_endpoint_service.proto | 335 + .../aiplatform/v1beta1/index_service.proto | 335 + .../google/cloud/aiplatform/v1beta1/io.proto | 108 + .../aiplatform/v1beta1/job_service.proto | 1008 ++ .../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 | 592 ++ .../model_deployment_monitoring_job.proto | 310 + .../aiplatform/v1beta1/model_evaluation.proto | 94 + .../v1beta1/model_evaluation_slice.proto | 71 + .../aiplatform/v1beta1/model_monitoring.proto | 239 + .../aiplatform/v1beta1/model_service.proto | 693 ++ .../cloud/aiplatform/v1beta1/operation.proto | 52 + .../v1beta1/pipeline_failure_policy.proto | 44 + .../aiplatform/v1beta1/pipeline_job.proto | 349 + .../aiplatform/v1beta1/pipeline_service.proto | 405 + .../aiplatform/v1beta1/pipeline_state.proto | 58 + .../v1beta1/prediction_service.proto | 231 + .../aiplatform/v1beta1/saved_query.proto | 85 + .../v1beta1/schema/annotation_payload.proto | 230 + .../schema/annotation_spec_color.proto | 42 + .../v1beta1/schema/data_item_payload.proto | 67 + .../v1beta1/schema/dataset_metadata.proto | 126 + .../aiplatform/v1beta1/schema/geometry.proto | 37 + .../instance/image_classification.proto | 43 + .../instance/image_object_detection.proto | 43 + .../predict/instance/image_segmentation.proto | 38 + .../instance/text_classification.proto | 37 + .../predict/instance/text_extraction.proto | 44 + .../predict/instance/text_sentiment.proto | 37 + .../instance/video_action_recognition.proto | 50 + .../instance/video_classification.proto | 50 + .../instance/video_object_tracking.proto | 50 + .../predict/params/image_classification.proto | 38 + .../params/image_object_detection.proto | 38 + .../predict/params/image_segmentation.proto | 35 + .../params/video_action_recognition.proto | 38 + .../predict/params/video_classification.proto | 63 + .../params/video_object_tracking.proto | 42 + .../predict/prediction/classification.proto | 40 + .../prediction/image_object_detection.proto | 50 + .../prediction/image_segmentation.proto | 44 + .../prediction/tabular_classification.proto | 38 + .../prediction/tabular_regression.proto | 38 + .../predict/prediction/text_extraction.proto | 51 + .../predict/prediction/text_sentiment.proto | 36 + .../prediction/time_series_forecasting.proto | 32 + .../prediction/video_action_recognition.proto | 53 + .../prediction/video_classification.proto | 66 + .../prediction/video_object_tracking.proto | 81 + .../automl_image_classification.proto | 127 + .../automl_image_object_detection.proto | 119 + .../automl_image_segmentation.proto | 105 + .../definition/automl_tables.proto | 283 + .../automl_text_classification.proto | 36 + .../definition/automl_text_extraction.proto | 36 + .../definition/automl_text_sentiment.proto | 43 + .../automl_time_series_forecasting.proto | 286 + .../automl_video_action_recognition.proto | 61 + .../automl_video_classification.proto | 55 + .../automl_video_object_tracking.proto | 66 + .../export_evaluated_data_items_config.proto | 42 + .../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 | 413 + .../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 | 68 + .../v1beta1/dataset_service.delete_dataset.js | 64 + .../v1beta1/dataset_service.export_data.js | 69 + .../dataset_service.get_annotation_spec.js | 67 + .../v1beta1/dataset_service.get_dataset.js | 65 + .../v1beta1/dataset_service.import_data.js | 70 + .../dataset_service.list_annotations.js | 86 + .../dataset_service.list_data_items.js | 86 + .../v1beta1/dataset_service.list_datasets.js | 99 + .../dataset_service.list_saved_queries.js | 86 + .../v1beta1/dataset_service.update_dataset.js | 71 + ...service.create_deployment_resource_pool.js | 77 + ...service.delete_deployment_resource_pool.js | 64 + ...ol_service.get_deployment_resource_pool.js | 63 + ..._service.list_deployment_resource_pools.js | 77 + ...urce_pool_service.query_deployed_models.js | 78 + .../endpoint_service.create_endpoint.js | 79 + .../endpoint_service.delete_endpoint.js | 64 + .../v1beta1/endpoint_service.deploy_model.js | 84 + .../v1beta1/endpoint_service.get_endpoint.js | 63 + .../endpoint_service.list_endpoints.js | 95 + .../endpoint_service.undeploy_model.js | 79 + .../endpoint_service.update_endpoint.js | 66 + ...ine_serving_service.read_feature_values.js | 77 + ...g_service.streaming_read_feature_values.js | 81 + ...ne_serving_service.write_feature_values.js | 71 + ...turestore_service.batch_create_features.js | 72 + ...store_service.batch_read_feature_values.js | 111 + ...featurestore_service.create_entity_type.js | 77 + .../featurestore_service.create_feature.js | 78 + ...eaturestore_service.create_featurestore.js | 78 + ...featurestore_service.delete_entity_type.js | 69 + .../featurestore_service.delete_feature.js | 64 + ...eaturestore_service.delete_featurestore.js | 70 + ...turestore_service.export_feature_values.js | 88 + .../featurestore_service.get_entity_type.js | 63 + .../featurestore_service.get_feature.js | 63 + .../featurestore_service.get_featurestore.js | 61 + ...turestore_service.import_feature_values.js | 114 + .../featurestore_service.list_entity_types.js | 112 + .../featurestore_service.list_features.js | 122 + ...featurestore_service.list_featurestores.js | 113 + .../featurestore_service.search_features.js | 132 + ...featurestore_service.update_entity_type.js | 84 + .../featurestore_service.update_feature.js | 78 + ...eaturestore_service.update_featurestore.js | 79 + ..._endpoint_service.create_index_endpoint.js | 68 + ..._endpoint_service.delete_index_endpoint.js | 64 + .../index_endpoint_service.deploy_index.js | 69 + ...dex_endpoint_service.get_index_endpoint.js | 63 + ...x_endpoint_service.list_index_endpoints.js | 98 + ..._endpoint_service.mutate_deployed_index.js | 71 + .../index_endpoint_service.undeploy_index.js | 69 + ..._endpoint_service.update_index_endpoint.js | 66 + .../v1beta1/index_service.create_index.js | 68 + .../v1beta1/index_service.delete_index.js | 64 + .../v1beta1/index_service.get_index.js | 63 + .../v1beta1/index_service.list_indexes.js | 83 + .../index_service.remove_datapoints.js | 67 + .../v1beta1/index_service.update_index.js | 67 + .../index_service.upsert_datapoints.js | 67 + ...job_service.cancel_batch_prediction_job.js | 63 + .../v1beta1/job_service.cancel_custom_job.js | 63 + .../job_service.cancel_data_labeling_job.js | 63 + ...ervice.cancel_hyperparameter_tuning_job.js | 63 + ...job_service.create_batch_prediction_job.js | 67 + .../v1beta1/job_service.create_custom_job.js | 67 + .../job_service.create_data_labeling_job.js | 67 + ...ervice.create_hyperparameter_tuning_job.js | 67 + ....create_model_deployment_monitoring_job.js | 67 + ...job_service.delete_batch_prediction_job.js | 64 + .../v1beta1/job_service.delete_custom_job.js | 64 + .../job_service.delete_data_labeling_job.js | 64 + ...ervice.delete_hyperparameter_tuning_job.js | 64 + ....delete_model_deployment_monitoring_job.js | 64 + .../job_service.get_batch_prediction_job.js | 63 + .../v1beta1/job_service.get_custom_job.js | 63 + .../job_service.get_data_labeling_job.js | 63 + ...b_service.get_hyperparameter_tuning_job.js | 63 + ...ice.get_model_deployment_monitoring_job.js | 63 + .../job_service.list_batch_prediction_jobs.js | 94 + .../v1beta1/job_service.list_custom_jobs.js | 93 + .../job_service.list_data_labeling_jobs.js | 99 + ...service.list_hyperparameter_tuning_jobs.js | 93 + ...e.list_model_deployment_monitoring_jobs.js | 90 + ...e.pause_model_deployment_monitoring_job.js | 63 + ....resume_model_deployment_monitoring_job.js | 63 + ...l_deployment_monitoring_stats_anomalies.js | 103 + ....update_model_deployment_monitoring_job.js | 92 + ...ce.add_context_artifacts_and_executions.js | 77 + .../metadata_service.add_context_children.js | 67 + .../metadata_service.add_execution_events.js | 68 + .../metadata_service.create_artifact.js | 79 + .../metadata_service.create_context.js | 79 + .../metadata_service.create_execution.js | 80 + ...metadata_service.create_metadata_schema.js | 80 + .../metadata_service.create_metadata_store.js | 80 + .../metadata_service.delete_artifact.js | 70 + .../metadata_service.delete_context.js | 75 + .../metadata_service.delete_execution.js | 70 + .../metadata_service.delete_metadata_store.js | 64 + .../v1beta1/metadata_service.get_artifact.js | 63 + .../v1beta1/metadata_service.get_context.js | 63 + .../v1beta1/metadata_service.get_execution.js | 63 + .../metadata_service.get_metadata_schema.js | 63 + .../metadata_service.get_metadata_store.js | 63 + .../metadata_service.list_artifacts.js | 105 + .../v1beta1/metadata_service.list_contexts.js | 108 + .../metadata_service.list_executions.js | 105 + .../metadata_service.list_metadata_schemas.js | 84 + .../metadata_service.list_metadata_stores.js | 80 + .../metadata_service.purge_artifacts.js | 76 + .../metadata_service.purge_contexts.js | 76 + .../metadata_service.purge_executions.js | 76 + ...service.query_artifact_lineage_subgraph.js | 96 + ..._service.query_context_lineage_subgraph.js | 67 + ...vice.query_execution_inputs_and_outputs.js | 64 + .../metadata_service.update_artifact.js | 75 + .../metadata_service.update_context.js | 75 + .../metadata_service.update_execution.js | 75 + ...gration_service.batch_migrate_resources.js | 70 + ...ion_service.search_migratable_resources.js | 90 + ...ce.batch_import_model_evaluation_slices.js | 68 + .../v1beta1/model_service.delete_model.js | 63 + .../model_service.delete_model_version.js | 64 + .../v1beta1/model_service.export_model.js | 69 + .../v1beta1/model_service.get_model.js | 71 + .../model_service.get_model_evaluation.js | 63 + ...odel_service.get_model_evaluation_slice.js | 63 + .../model_service.import_model_evaluation.js | 67 + ...el_service.list_model_evaluation_slices.js | 85 + .../model_service.list_model_evaluations.js | 83 + .../model_service.list_model_versions.js | 89 + .../v1beta1/model_service.list_models.js | 95 + .../model_service.merge_version_aliases.js | 78 + ...odel_service.update_explanation_dataset.js | 67 + .../v1beta1/model_service.update_model.js | 84 + .../v1beta1/model_service.upload_model.js | 80 + .../pipeline_service.cancel_pipeline_job.js | 63 + ...peline_service.cancel_training_pipeline.js | 63 + .../pipeline_service.create_pipeline_job.js | 75 + ...peline_service.create_training_pipeline.js | 67 + .../pipeline_service.delete_pipeline_job.js | 64 + ...peline_service.delete_training_pipeline.js | 64 + .../pipeline_service.get_pipeline_job.js | 63 + .../pipeline_service.get_training_pipeline.js | 63 + .../pipeline_service.list_pipeline_jobs.js | 122 + ...ipeline_service.list_training_pipelines.js | 95 + .../v1beta1/prediction_service.explain.js | 99 + .../v1beta1/prediction_service.predict.js | 83 + .../v1beta1/prediction_service.raw_predict.js | 77 + ...adata.google.cloud.aiplatform.v1beta1.json | 9199 +++++++++++++++++ ...ist_pool_service.create_specialist_pool.js | 68 + ...ist_pool_service.delete_specialist_pool.js | 69 + ...ialist_pool_service.get_specialist_pool.js | 63 + ...list_pool_service.list_specialist_pools.js | 79 + ...ist_pool_service.update_specialist_pool.js | 67 + ...d_service.batch_create_tensorboard_runs.js | 71 + ...ce.batch_create_tensorboard_time_series.js | 73 + ...batch_read_tensorboard_time_series_data.js | 71 + .../tensorboard_service.create_tensorboard.js | 68 + ...d_service.create_tensorboard_experiment.js | 75 + ...sorboard_service.create_tensorboard_run.js | 76 + ..._service.create_tensorboard_time_series.js | 76 + .../tensorboard_service.delete_tensorboard.js | 64 + ...d_service.delete_tensorboard_experiment.js | 64 + ...sorboard_service.delete_tensorboard_run.js | 64 + ..._service.delete_tensorboard_time_series.js | 64 + ...ice.export_tensorboard_time_series_data.js | 90 + .../tensorboard_service.get_tensorboard.js | 63 + ...oard_service.get_tensorboard_experiment.js | 63 + ...tensorboard_service.get_tensorboard_run.js | 63 + ...ard_service.get_tensorboard_time_series.js | 63 + ...rd_service.list_tensorboard_experiments.js | 93 + ...nsorboard_service.list_tensorboard_runs.js | 93 + ...rd_service.list_tensorboard_time_series.js | 93 + .../tensorboard_service.list_tensorboards.js | 93 + ...oard_service.read_tensorboard_blob_data.js | 69 + ...rvice.read_tensorboard_time_series_data.js | 73 + .../tensorboard_service.update_tensorboard.js | 74 + ...d_service.update_tensorboard_experiment.js | 73 + ...sorboard_service.update_tensorboard_run.js | 73 + ..._service.update_tensorboard_time_series.js | 74 + ...rvice.write_tensorboard_experiment_data.js | 68 + ...oard_service.write_tensorboard_run_data.js | 72 + .../vizier_service.add_trial_measurement.js | 68 + ...ervice.check_trial_early_stopping_state.js | 64 + .../v1beta1/vizier_service.complete_trial.js | 79 + .../v1beta1/vizier_service.create_study.js | 67 + .../v1beta1/vizier_service.create_trial.js | 67 + .../v1beta1/vizier_service.delete_study.js | 62 + .../v1beta1/vizier_service.delete_trial.js | 63 + .../v1beta1/vizier_service.get_study.js | 62 + .../v1beta1/vizier_service.get_trial.js | 63 + .../vizier_service.list_optimal_trials.js | 61 + .../v1beta1/vizier_service.list_studies.js | 74 + .../v1beta1/vizier_service.list_trials.js | 74 + .../v1beta1/vizier_service.lookup_study.js | 67 + .../v1beta1/vizier_service.stop_trial.js | 63 + .../v1beta1/vizier_service.suggest_trials.js | 76 + owl-bot-staging/v1beta1/src/index.ts | 55 + .../src/v1beta1/dataset_service_client.ts | 4349 ++++++++ .../dataset_service_client_config.json | 80 + .../v1beta1/dataset_service_proto_list.json | 121 + ...deployment_resource_pool_service_client.ts | 3556 +++++++ ...t_resource_pool_service_client_config.json | 46 + ...ment_resource_pool_service_proto_list.json | 121 + .../src/v1beta1/endpoint_service_client.ts | 3681 +++++++ .../endpoint_service_client_config.json | 61 + .../v1beta1/endpoint_service_proto_list.json | 121 + ...turestore_online_serving_service_client.ts | 3032 ++++++ ..._online_serving_service_client_config.json | 40 + ...ore_online_serving_service_proto_list.json | 121 + .../v1beta1/featurestore_service_client.ts | 5858 +++++++++++ .../featurestore_service_client_config.json | 125 + .../featurestore_service_proto_list.json | 121 + .../v1beta1/src/v1beta1/gapic_metadata.json | 2369 +++++ owl-bot-staging/v1beta1/src/v1beta1/index.ts | 34 + .../v1beta1/index_endpoint_service_client.ts | 3765 +++++++ .../index_endpoint_service_client_config.json | 65 + .../index_endpoint_service_proto_list.json | 121 + .../src/v1beta1/index_service_client.ts | 3581 +++++++ .../v1beta1/index_service_client_config.json | 59 + .../src/v1beta1/index_service_proto_list.json | 121 + .../v1beta1/src/v1beta1/job_service_client.ts | 6139 +++++++++++ .../v1beta1/job_service_client_config.json | 166 + .../src/v1beta1/job_service_proto_list.json | 121 + .../src/v1beta1/metadata_service_client.ts | 6464 ++++++++++++ .../metadata_service_client_config.json | 175 + .../v1beta1/metadata_service_proto_list.json | 121 + .../src/v1beta1/migration_service_client.ts | 3189 ++++++ .../migration_service_client_config.json | 34 + .../v1beta1/migration_service_proto_list.json | 121 + .../src/v1beta1/model_service_client.ts | 4812 +++++++++ .../v1beta1/model_service_client_config.json | 100 + .../src/v1beta1/model_service_proto_list.json | 121 + .../src/v1beta1/pipeline_service_client.ts | 4103 ++++++++ .../pipeline_service_client_config.json | 71 + .../v1beta1/pipeline_service_proto_list.json | 121 + .../src/v1beta1/prediction_service_client.ts | 3097 ++++++ .../prediction_service_client_config.json | 40 + .../prediction_service_proto_list.json | 121 + .../v1beta1/specialist_pool_service_client.ts | 3430 ++++++ ...specialist_pool_service_client_config.json | 51 + .../specialist_pool_service_proto_list.json | 121 + .../src/v1beta1/tensorboard_service_client.ts | 5933 +++++++++++ .../tensorboard_service_client_config.json | 138 + .../tensorboard_service_proto_list.json | 121 + .../src/v1beta1/vizier_service_client.ts | 4260 ++++++++ .../v1beta1/vizier_service_client_config.json | 101 + .../v1beta1/vizier_service_proto_list.json | 121 + .../system-test/fixtures/sample/src/index.js | 42 + .../system-test/fixtures/sample/src/index.ts | 122 + .../v1beta1/system-test/install.ts | 49 + .../test/gapic_dataset_service_v1beta1.ts | 4615 +++++++++ ...eployment_resource_pool_service_v1beta1.ts | 3627 +++++++ .../test/gapic_endpoint_service_v1beta1.ts | 3772 +++++++ ...urestore_online_serving_service_v1beta1.ts | 2937 ++++++ .../gapic_featurestore_service_v1beta1.ts | 5947 +++++++++++ .../gapic_index_endpoint_service_v1beta1.ts | 3926 +++++++ .../test/gapic_index_service_v1beta1.ts | 3726 +++++++ .../v1beta1/test/gapic_job_service_v1beta1.ts | 6817 ++++++++++++ .../test/gapic_metadata_service_v1beta1.ts | 7134 +++++++++++++ .../test/gapic_migration_service_v1beta1.ts | 3090 ++++++ .../test/gapic_model_service_v1beta1.ts | 5201 ++++++++++ .../test/gapic_pipeline_service_v1beta1.ts | 4137 ++++++++ .../test/gapic_prediction_service_v1beta1.ts | 2934 ++++++ .../gapic_specialist_pool_service_v1beta1.ts | 3510 +++++++ .../test/gapic_tensorboard_service_v1beta1.ts | 6723 ++++++++++++ .../test/gapic_vizier_service_v1beta1.ts | 4677 +++++++++ owl-bot-staging/v1beta1/tsconfig.json | 19 + owl-bot-staging/v1beta1/webpack.config.js | 64 + 780 files changed, 373728 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_failure_policy.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/saved_query.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.list_saved_queries.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.remove_datapoints.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/index_service.upsert_datapoints.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.batch_import_model_evaluation_slices.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.delete_model_version.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_model_versions.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.merge_version_aliases.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/deployment_resource_pool.proto create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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.list_saved_queries.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/deployment_resource_pool_service.create_deployment_resource_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.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_online_serving_service.write_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.remove_datapoints.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/index_service.upsert_datapoints.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.batch_import_model_evaluation_slices.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/deployment_resource_pool_service_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_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_deployment_resource_pool_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..36769bb3 --- /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/ && minifyProtoJson", + "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": "^3.5.1" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.59", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} 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..3212d0ce --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto @@ -0,0 +1,292 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. + // + // The model resource name may contain version id or version alias to specify + // the version, if no version is specified, the default version will be used. + 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.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..a1d7b323 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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]; + + // Output only. The number of the successful forecast points that are generated by the + // forecasting model. This is ONLY used by the forecasting batch prediction. + int64 successful_forecast_point_count = 5 [(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..38d68c01 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto @@ -0,0 +1,280 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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: 15 +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; + + // Optional. 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.field_behavior) = OPTIONAL, + (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..c26f60e3 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto @@ -0,0 +1,461 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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/cloud/aiplatform/v1/saved_query.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"; + } + + // Lists SavedQueries in a Dataset. + rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/datasets/*}/savedQueries" + }; + 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.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries]. +message ListSavedQueriesRequest { + // Required. The resource name of the Dataset to list SavedQueries 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.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries]. +message ListSavedQueriesResponse { + // A list of SavedQueries that match the specified filter in the request. + repeated SavedQuery saved_queries = 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..6d48f8f2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto @@ -0,0 +1,258 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 resource 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. + // + // The resource name may contain version id or version alias to specify the + // version, if no version is specified, the default version will be deployed. + 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.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..0c00d8a2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto @@ -0,0 +1,461 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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]; + + // 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.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]; +} + +// 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]; + + // Optional. Metadata describing the Model's input and output for explanation. + ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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_indices 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 example-based explanations parameter overrides. + ExamplesOverride examples_override = 3; +} + +// 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]; +} + +// 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/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..5ee0c1ce --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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; + + // Name of the source to generate embeddings for example based explanations. + string latent_space_source = 5; +} 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..4c8a72f5 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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 { + // 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/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..915c4c3f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto @@ -0,0 +1,224 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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. +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..9adfec3f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto @@ -0,0 +1,1226 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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` + // * `online_serving_config.scaling` + 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..69fde66a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto @@ -0,0 +1,172 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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}" + }; + + // The update method of an Index. + enum IndexUpdateMethod { + // Should not be used. + INDEX_UPDATE_METHOD_UNSPECIFIED = 0; + + // BatchUpdate: user can call UpdateIndex with files on Cloud Storage of + // datapoints to update. + BATCH_UPDATE = 1; + + // StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update + // the Index and the updates will be applied in corresponding + // DeployedIndexes in nearly real-time. + STREAM_UPDATE = 2; + } + + // 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]; + + // Output only. Stats of the index resource. + IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be + // used by default. + IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A datapoint of Index. +message IndexDatapoint { + // Restriction of a datapoint which describe its attributes(tokens) from each + // of several attribute categories(namespaces). + message Restriction { + // The namespace of this restriction. eg: color. + string namespace = 1; + + // The attributes to allow in this namespace. eg: 'red' + repeated string allow_list = 2; + + // The attributes to deny in this namespace. eg: 'blue' + repeated string deny_list = 3; + } + + // Crowding tag is a constraint on a neighbor list produced by nearest + // neighbor search requiring that no more than some value k' of the k + // neighbors returned have the same value of crowding_attribute. + message CrowdingTag { + // The attribute value used for crowding. The maximum number of neighbors + // to return per crowding attribute value + // (per_crowding_attribute_num_neighbors) is configured per-query. This + // field is ignored if per_crowding_attribute_num_neighbors is larger than + // the total number of neighbors to return for a given query. + string crowding_attribute = 1; + } + + // Required. Unique identifier of the datapoint. + string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feature embedding vector. An array of numbers with the length of + // [NearestNeighborSearchConfig.dimensions]. + repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of Restrict of the datapoint, used to perform "restricted searches" + // where boolean rule are used to filter the subset of the database eligible + // for matching. + // See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering + repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CrowdingTag of the datapoint, the number of neighbors to return in each + // crowding can be configured during query. + CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Stats of the Index. +message IndexStats { + // Output only. The number of vectors in the Index. + int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of shards in the Index. + int32 shards_count = 2 [(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..0f6c6325 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_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.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" + }; + } + + // Add/update Datapoints into an Index. + rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) { + option (google.api.http) = { + post: "/v1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints" + body: "*" + }; + } + + // Remove Datapoints from an Index. + rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) { + option (google.api.http) = { + post: "/v1/{index=projects/*/locations/*/indexes/*}:removeDatapoints" + body: "*" + }; + } +} + +// 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" + } + ]; +} + +// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] +message UpsertDatapointsRequest { + // Required. The name of the Index resource to be updated. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string index = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // A list of datapoints to be created/updated. + repeated IndexDatapoint datapoints = 2; +} + +// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] +message UpsertDatapointsResponse { + +} + +// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] +message RemoveDatapointsRequest { + // Required. The name of the Index resource to be updated. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string index = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // A list of datapoint ids to be deleted. + repeated string datapoint_ids = 2; +} + +// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] +message RemoveDatapointsResponse { + +} + +// 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..82198a26 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto @@ -0,0 +1,1008 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `model_display_name` supports `=`, `!=` comparisons. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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. + // + // Supported fields: + // + // * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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..e469d45e --- /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 64. + 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..26c1d3b7 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto @@ -0,0 +1,592 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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; + + // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1.DeployedModel]. + // A pre-configured [DeploymentResourcePool][] is required. + SHARED_RESOURCES = 3; + } + + // 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.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..87252239 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto @@ -0,0 +1,310 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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]; + + // The time window of the prediction data being included in each prediction + // dataset. This window specifies how long the data should be collected from + // historical model results for each run. If not set, + // [ModelDeploymentMonitoringScheduleConfig.monitor_interval][google.cloud.aiplatform.v1.ModelDeploymentMonitoringScheduleConfig.monitor_interval] will be used. + // e.g. If currently the cutoff time is 2022-01-08 14:30:00 and the + // monitor_window is set to be 3600, then data from 2022-01-08 13:30:00 + // to 2022-01-08 14:30:00 will be retrieved and aggregated to calculate the + // monitoring statistics. + google.protobuf.Duration monitor_window = 2; +} + +// 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..039161dd --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto @@ -0,0 +1,212 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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"; + +// The objective configuration for model monitoring, including the information +// needed to detect anomalies for one particular model. +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. + // "jsonl" + // The source file is a JSONL 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; + + // Skew anomaly detection threshold used by all features. + // When the per-feature thresholds are not set, this field can be used to + // specify a threshold for all features. + ThresholdConfig default_skew_threshold = 6; + } + + // 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; + + // Drift anomaly detection threshold used by all features. + // When the per-feature thresholds are not set, this field can be used to + // specify a threshold for all features. + ThresholdConfig default_drift_threshold = 5; + } + + // 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; +} + +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. +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. +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..9ea6c56c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto @@ -0,0 +1,662 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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"; + } + + // Lists versions of the specified model. + rpc ListModelVersions(ListModelVersionsRequest) returns (ListModelVersionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}:listVersions" + }; + option (google.api.method_signature) = "name"; + } + + // 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" + }; + } + + // 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.v1.ModelService.DeleteModel] for deleting the Model instead. + rpc DeleteModelVersion(DeleteModelVersionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{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: "/v1/{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.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"; + } + + // Imports a list of externally generated ModelEvaluationSlice. + rpc BatchImportModelEvaluationSlices(BatchImportModelEvaluationSlicesRequest) returns (BatchImportModelEvaluationSlicesResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices:batchImport" + body: "*" + }; + option (google.api.method_signature) = "parent,model_evaluation_slices"; + } + + // 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" + } + ]; + + // 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.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" + }]; + + // 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.v1.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.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.ListModelVersions][google.cloud.aiplatform.v1.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.v1.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.v1.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.v1.ListModelVersionsRequest.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.DeleteModelVersion][google.cloud.aiplatform.v1.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.v1.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-zA-Z0-9-]{0,126}[a-z-0-9]`. + // Add the `-` prefix to an alias means removing that alias from the version. + // `-` is NOT counted in the 128 characters. Example: `-golden` means removing + // the `golden` alias from the version. + // + // There is NO ordering in aliases, which means + // 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.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. + // 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.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.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.BatchImportModelEvaluationSlices] +message BatchImportModelEvaluationSlicesRequest { + // Required. The name of the parent ModelEvaluation resource. + // 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" + } + ]; + + // Required. Model evaluation slice resource to be imported. + repeated ModelEvaluationSlice model_evaluation_slices = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.BatchImportModelEvaluationSlices] +message BatchImportModelEvaluationSlicesResponse { + // Output only. List of imported [ModelEvaluationSlice.name][google.cloud.aiplatform.v1.ModelEvaluationSlice.name]. + repeated string imported_model_evaluation_slices = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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_failure_policy.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto new file mode 100644 index 00000000..5ff3b78b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.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; + +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 = "PipelineFailurePolicyProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Represents the failure policy of a pipeline. Currently, the default of a +// pipeline is that the pipeline will continue to run until no more tasks can be +// executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a +// pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling +// any new tasks when a task has failed. Any scheduled tasks will continue to +// completion. +enum PipelineFailurePolicy { + // Default value, and follows fail slow behavior. + PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0; + + // Indicates that the pipeline should continue to run until all possible + // tasks have been scheduled and completed. + PIPELINE_FAILURE_POLICY_FAIL_SLOW = 1; + + // Indicates that the pipeline should stop scheduling new tasks after a task + // has failed. + PIPELINE_FAILURE_POLICY_FAIL_FAST = 2; +} 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..656a385b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto @@ -0,0 +1,365 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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_failure_policy.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 { + // The type of an input artifact. + message InputArtifact { + oneof kind { + // Artifact resource id from MLMD. Which is the last portion of an + // artifact resource + // name(projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}). + // The artifact must stay within the same project, location and default + // metadatastore as the pipeline. + string artifact_id = 1; + } + } + + // 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; + + // Represents the failure policy of a pipeline. Currently, the default of a + // pipeline is that the pipeline will continue to run until no more tasks + // can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. + // However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it + // will stop scheduling any new tasks when a task has failed. Any scheduled + // tasks will continue to completion. + PipelineFailurePolicy failure_policy = 4; + + // The runtime artifacts of the PipelineJob. The key will be the input + // artifact name and the value would be one of the InputArtifact. + map input_artifacts = 5; + } + + // 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.v1.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.v1.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.v1.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.v1.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.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..41fef466 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto @@ -0,0 +1,408 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + // * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + // * `NOT display_name="my_pipeline"` + // * `create_time>"2021-05-18T00:00:00Z"` + // * `training_task_definition:"*automl_text_classification*"` + 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`: 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; + + // Mask specifying which fields to read. + google.protobuf.FieldMask read_mask = 7; +} + +// 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..36096fd9 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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 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.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/saved_query.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/saved_query.proto new file mode 100644 index 00000000..5332222d --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/saved_query.proto @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 = "SavedQueryProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A SavedQuery is a view of the dataset. It references a subset of annotations +// by problem type and filters. +message SavedQuery { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/SavedQuery" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}" + }; + + // Output only. Resource name of the SavedQuery. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the SavedQuery. + // 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]; + + // Some additional information about the SavedQuery. + google.protobuf.Value metadata = 12; + + // Output only. Timestamp when this SavedQuery was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when SavedQuery was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Filters on the Annotations in the dataset. + string annotation_filter = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Problem type of the SavedQuery. + // Allowed values: + // + // * IMAGE_CLASSIFICATION_SINGLE_LABEL + // * IMAGE_CLASSIFICATION_MULTI_LABEL + // * IMAGE_BOUNDING_POLY + // * IMAGE_BOUNDING_BOX + // * TEXT_CLASSIFICATION_SINGLE_LABEL + // * TEXT_CLASSIFICATION_MULTI_LABEL + // * TEXT_EXTRACTION + // * TEXT_SENTIMENT + // * VIDEO_CLASSIFICATION + // * VIDEO_OBJECT_TRACKING + string problem_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Number of AnnotationSpecs in the context of the SavedQuery. + int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform a consistent read-modify-write update. If not set, a blind + // "overwrite" update happens. + string etag = 8; + + // Output only. If the Annotations belonging to the SavedQuery can be used for AutoML + // training. + bool support_automl_training = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} 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..7ebb77ab --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.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.instance; + + +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..96aa4b14 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.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.instance; + + +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..95dbf98c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.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; + + +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..7d977a2f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/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.predict.instance; + + +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..b0b60c0f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.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; + + +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..15ded40b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/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.instance; + + +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..a43507dd --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto @@ -0,0 +1,50 @@ +// 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; + + +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..70318a60 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto @@ -0,0 +1,50 @@ +// 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; + + +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..26b34930 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto @@ -0,0 +1,50 @@ +// 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; + + +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..6aab8b46 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_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.params; + + +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..e957e2af --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.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.params; + + +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..5469108a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto @@ -0,0 +1,35 @@ +// 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; + + +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..ba6ec540 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.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.params; + + +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..f4325f8a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto @@ -0,0 +1,63 @@ +// 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; + + +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..82449062 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto @@ -0,0 +1,42 @@ +// 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; + + +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..be54f2c8 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto @@ -0,0 +1,40 @@ +// 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; + + +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..b0bb842e --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto @@ -0,0 +1,50 @@ +// 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"; + +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..20ff4f6d --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.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.prediction; + + +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..979461bd --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_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.prediction; + + +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..ba6bc6a7 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.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.prediction; + + +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..f74a82bf --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.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; + + +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..4e8d5ec2 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.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.prediction; + + +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..35aecb6c --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto @@ -0,0 +1,53 @@ +// 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"; + +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..fee01c7e --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto @@ -0,0 +1,66 @@ +// 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"; + +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..d445c0cc --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto @@ -0,0 +1,81 @@ +// 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"; + +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..0f2c1ea4 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.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.v1.schema.trainingjob.definition; + + +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..1459a85a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto @@ -0,0 +1,119 @@ +// 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; + + +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..8303ef69 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto @@ -0,0 +1,105 @@ +// 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; + + +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..5b43fc7b --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto @@ -0,0 +1,283 @@ +// 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/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.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..1713e6a6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.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.trainingjob.definition; + + +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..01f56c31 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.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.trainingjob.definition; + + +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..cb3f0ac5 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.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; + + +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..331033bd --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto @@ -0,0 +1,61 @@ +// 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; + + +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..194ea3c6 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto @@ -0,0 +1,55 @@ +// 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; + + +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..d97e356f --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto @@ -0,0 +1,66 @@ +// 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; + + +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..eaa3298a --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto @@ -0,0 +1,42 @@ +// 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; + + +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..c61a4a3f --- /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 HyperparameterTuningJob 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 HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported + // by HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported + // by HyperparameterTuningJob 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 + // HyperparameterTuningJob 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..a0de8cf4 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto @@ -0,0 +1,413 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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; + + // 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.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDataset, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataset, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importData, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportData, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SavedQueries 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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery}. + * 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 `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueries( + request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.ISavedQuery[], + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest|null, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse + ]>; + listSavedQueries( + request: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISavedQuery>): void; + listSavedQueries( + request: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISavedQuery>): void; + listSavedQueries( + request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISavedQuery>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1.ISavedQuery>): + Promise<[ + protos.google.cloud.aiplatform.v1.ISavedQuery[], + protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest|null, + protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSavedQueries(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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery} 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 `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueriesStream( + request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.createStream( + this.innerApiCalls.listSavedQueries as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSavedQueries`, 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 SavedQueries 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 + * [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery}. 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_ListSavedQueries_async + */ + listSavedQueriesAsync( + request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.asyncIterate( + this.innerApiCalls['listSavedQueries'] as GaxCall, + request as {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..69bc6d22 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/dataset_service_client_config.json @@ -0,0 +1,70 @@ +{ + "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" + }, + "ListSavedQueries": { + "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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..ac1f69dd --- /dev/null +++ b/owl-bot-staging/v1/src/v1/endpoint_service_client.ts @@ -0,0 +1,3656 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new EndpointServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployModel, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployModel, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..0b5ad3c0 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts @@ -0,0 +1,2898 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FeaturestoreOnlineServingServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + + this.descriptors.longrunning = { + }; + + // 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 = this._gaxModule.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 this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity_type': request.entityType ?? '', + }); + this.initialize(); + return this.innerApiCalls.streamingReadFeatureValues(request, options); + } + +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..f703a73a --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_service_client.ts @@ -0,0 +1,5806 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FeaturestoreServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeaturestore, this._gaxModule.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` + * * `online_serving_config.scaling` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFeaturestore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEntityType, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEntityType, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeature, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeature, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..bc7d2508 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/gapic_metadata.json @@ -0,0 +1,2277 @@ +{ + "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" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "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" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "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" + ] + }, + "UpsertDatapoints": { + "methods": [ + "upsertDatapoints" + ] + }, + "RemoveDatapoints": { + "methods": [ + "removeDatapoints" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "UpsertDatapoints": { + "methods": [ + "upsertDatapoints" + ] + }, + "RemoveDatapoints": { + "methods": [ + "removeDatapoints" + ] + }, + "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" + ] + }, + "BatchImportModelEvaluationSlices": { + "methods": [ + "batchImportModelEvaluationSlices" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "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" + ] + }, + "BatchImportModelEvaluationSlices": { + "methods": [ + "batchImportModelEvaluationSlices" + ] + }, + "GetModelEvaluation": { + "methods": [ + "getModelEvaluation" + ] + }, + "GetModelEvaluationSlice": { + "methods": [ + "getModelEvaluationSlice" + ] + }, + "UploadModel": { + "methods": [ + "uploadModel" + ] + }, + "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/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..5bf5c018 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_endpoint_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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new IndexEndpointServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..3f3fc1e7 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_client.ts @@ -0,0 +1,3529 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new IndexServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'upsertDatapoints', 'removeDatapoints']; + 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._opts.fallback + ); + + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIndex(request, options, callback); + } +/** + * Add/update Datapoints into an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.index + * Required. The name of the Index resource to be updated. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {number[]} request.datapoints + * A list of datapoints to be created/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 [UpsertDatapointsResponse]{@link google.cloud.aiplatform.v1.UpsertDatapointsResponse}. + * Please see 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_UpsertDatapoints_async + */ + upsertDatapoints( + request?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|undefined, {}|undefined + ]>; + upsertDatapoints( + request: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): void; + upsertDatapoints( + request: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): void; + upsertDatapoints( + request?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'index': request.index ?? '', + }); + this.initialize(); + return this.innerApiCalls.upsertDatapoints(request, options, callback); + } +/** + * Remove Datapoints from an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.index + * Required. The name of the Index resource to be updated. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {string[]} request.datapointIds + * A list of datapoint ids to 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 [RemoveDatapointsResponse]{@link google.cloud.aiplatform.v1.RemoveDatapointsResponse}. + * Please see 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_RemoveDatapoints_async + */ + removeDatapoints( + request?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|undefined, {}|undefined + ]>; + removeDatapoints( + request: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): void; + removeDatapoints( + request: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): void; + removeDatapoints( + request?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'index': request.index ?? '', + }); + this.initialize(); + return this.innerApiCalls.removeDatapoints(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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndex, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..fb5e197f --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_client_config.json @@ -0,0 +1,54 @@ +{ + "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" + }, + "UpsertDatapoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDatapoints": { + "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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..a062e176 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/job_service_client.ts @@ -0,0 +1,6087 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/job_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..e6ee4c38 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/metadata_service_client.ts @@ -0,0 +1,6412 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MetadataServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMetadataStore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteArtifact, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeArtifacts, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteContext, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeContexts, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeExecutions, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..49eab312 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/migration_service_client.ts @@ -0,0 +1,3137 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MigrationServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchMigrateResources, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/migration_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..37378868 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_client.ts @@ -0,0 +1,4688 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ModelServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 deleteModelVersionResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteModelVersionMetadata = 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)), + 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.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 = this._gaxModule.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', 'listModelVersions', 'updateModel', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', 'exportModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', '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._opts.fallback + ); + + 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.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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-zA-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.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_MergeVersionAliases_async + */ + mergeVersionAliases( + request?: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|undefined, {}|undefined + ]>; + mergeVersionAliases( + request: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): void; + mergeVersionAliases( + request: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): void; + mergeVersionAliases( + request?: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel, + protos.google.cloud.aiplatform.v1.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' + ] = this._gaxModule.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.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.importModelEvaluation(request, options, callback); + } +/** + * Imports a list of externally generated ModelEvaluationSlice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent ModelEvaluation resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {number[]} request.modelEvaluationSlices + * Required. Model evaluation slice 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 [BatchImportModelEvaluationSlicesResponse]{@link google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse}. + * Please see 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_BatchImportModelEvaluationSlices_async + */ + batchImportModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined + ]>; + batchImportModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): void; + batchImportModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): void; + batchImportModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchImportModelEvaluationSlices(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' + ] = this._gaxModule.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' + ] = this._gaxModule.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.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.uploadModel, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModel, this._gaxModule.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.v1.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_v1_generated_ModelService_DeleteModelVersion_async + */ + deleteModelVersion( + request?: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteModelVersion( + request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelVersion( + request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteModelVersion( + request?: protos.google.cloud.aiplatform.v1.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' + ] = this._gaxModule.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_v1_generated_ModelService_DeleteModelVersion_async + */ + async checkDeleteModelVersionProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelVersion, this._gaxModule.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. + * 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.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportModel, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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.v1.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.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 `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.v1.IListModelVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel[], + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest|null, + protos.google.cloud.aiplatform.v1.IListModelVersionsResponse + ]>; + listModelVersions( + request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): void; + listModelVersions( + request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): void; + listModelVersions( + request?: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, + protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, + protos.google.cloud.aiplatform.v1.IModel>): + Promise<[ + protos.google.cloud.aiplatform.v1.IModel[], + protos.google.cloud.aiplatform.v1.IListModelVersionsRequest|null, + protos.google.cloud.aiplatform.v1.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' + ] = this._gaxModule.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.v1.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.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 `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.v1.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' + ] = this._gaxModule.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 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.v1.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.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_ListModelVersions_async + */ + listModelVersionsAsync( + request?: protos.google.cloud.aiplatform.v1.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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..c067ea14 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_client_config.json @@ -0,0 +1,86 @@ +{ + "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" + }, + "ListModelVersions": { + "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" + }, + "DeleteModelVersion": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MergeVersionAliases": { + "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" + }, + "BatchImportModelEvaluationSlices": { + "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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/model_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..72a1c309 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/pipeline_service_client.ts @@ -0,0 +1,4057 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PipelineServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePipelineJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 {}, + 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`: 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 {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 [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' + ] = this._gaxModule.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`: 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 {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 [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' + ] = this._gaxModule.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 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`: 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 {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 + * [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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..5eaa3ace --- /dev/null +++ b/owl-bot-staging/v1/src/v1/prediction_service_client.ts @@ -0,0 +1,3045 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PredictionServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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}' + ), + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + + this.descriptors.longrunning = { + }; + + // 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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'endpoint': request.endpoint ?? '', + }); + this.initialize(); + return this.innerApiCalls.explain(request, options, callback); + } + +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..a1363ad8 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts @@ -0,0 +1,3378 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpecialistPoolServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..0551bebd --- /dev/null +++ b/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts @@ -0,0 +1,5882 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform, 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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TensorboardServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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 this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..930c57e4 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/vizier_service_client.ts @@ -0,0 +1,4208 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new VizierServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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. It must be positive. + * @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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.suggestTrials, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..d82a7a8b --- /dev/null +++ b/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json @@ -0,0 +1,112 @@ +[ + "../../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_failure_policy.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/saved_query.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..557a5755 --- /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..0ecf1e67 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts @@ -0,0 +1,4569 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataItems(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSavedQueries', () => { + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); + const [response] = await client.listSavedQueries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSavedQueries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISavedQuery[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSavedQueries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSavedQueries(request), expectedError); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.SavedQuery) => { + 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.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1.SavedQuery) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.ISavedQuery[] = []; + const iterable = client.listSavedQueriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSavedQueriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.ISavedQuery[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnnotations(request), expectedError); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..9e46f8e1 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts @@ -0,0 +1,3726 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEndpoints(request), expectedError); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..f7d78101 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts @@ -0,0 +1,2783 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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 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.FeaturestoreOnlineServingServiceClient', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + 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('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..3181339f --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts @@ -0,0 +1,5901 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEntityType(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEntityType(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeature(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateFeatures(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeature(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchReadFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchReadFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeaturestores(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEntityTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..24a56ef1 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts @@ -0,0 +1,3880 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexEndpoints(request), expectedError); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..034673a4 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_index_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 indexserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndex(request), expectedError); + }); + }); + + describe('upsertDatapoints', () => { + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() + ); + client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); + const [response] = await client.upsertDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() + ); + client.innerApiCalls.upsertDatapoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upsertDatapoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.upsertDatapoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.upsertDatapoints(request), expectedError); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.upsertDatapoints(request), expectedError); + }); + }); + + describe('removeDatapoints', () => { + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() + ); + client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); + const [response] = await client.removeDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() + ); + client.innerApiCalls.removeDatapoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDatapoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDatapoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDatapoints(request), expectedError); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeDatapoints(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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexes(request), expectedError); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..3c286ae7 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_job_service_v1.ts @@ -0,0 +1,6771 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.pauseModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.resumeModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataLabelingJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteHyperparameterTuningJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBatchPredictionJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBatchPredictionJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..a92a2169 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts @@ -0,0 +1,7088 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createContext(request), expectedError); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getContext(request), expectedError); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateContext(request), expectedError); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextChildren(request), expectedError); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addExecutionEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMetadataSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteArtifact(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeArtifacts(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeArtifacts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteContext(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteContext(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeContexts(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeContexts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteExecution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeExecutions(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataStores(request), expectedError); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listArtifacts(request), expectedError); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listContexts(request), expectedError); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataSchemas(request), expectedError); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..edf9e728 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_migration_service_v1.ts @@ -0,0 +1,3044 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchMigrateResources(request), expectedError); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchMigrateResources(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchMigratableResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..399a6ade --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_model_service_v1.ts @@ -0,0 +1,5001 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateModel(request), expectedError); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + 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.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.Model() + ); + client.innerApiCalls.mergeVersionAliases = stubSimpleCall(expectedResponse); + const [response] = await client.mergeVersionAliases(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.Model() + ); + client.innerApiCalls.mergeVersionAliases = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.mergeVersionAliases( + 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); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.mergeVersionAliases(request), expectedError); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + 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.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.importModelEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importModelEvaluation(request), expectedError); + }); + }); + + describe('batchImportModelEvaluationSlices', () => { + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() + ); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(expectedResponse); + const [response] = await client.batchImportModelEvaluationSlices(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() + ); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchImportModelEvaluationSlices( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchImportModelEvaluationSlices(request), expectedError); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchImportModelEvaluationSlices(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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.uploadModel(request), expectedError); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.uploadModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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('deleteModelVersion', () => { + it('invokes deleteModelVersion 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.DeleteModelVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModelVersion 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.DeleteModelVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModelVersion 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.DeleteModelVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteModelVersion 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.DeleteModelVersionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteModelVersionProgress 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.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.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.checkDeleteModelVersionProgress(''), 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listModelVersions', () => { + it('invokes listModelVersions 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;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.listModelVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listModelVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersions 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;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.listModelVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelVersions( + 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); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersions 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionsStream 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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.listModelVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listModelVersionsStream(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.listModelVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelVersionsStream 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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.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.listModelVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersions 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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.listModelVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.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( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersions 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.ListModelVersionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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.v1.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( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluationSlices(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..56a33880 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts @@ -0,0 +1,4091 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.cancelTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTrainingPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePipelineJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrainingPipelines(request), expectedError); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPipelineJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..aef55fde --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts @@ -0,0 +1,2888 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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 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.PredictionServiceClient', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); + const [response] = await client.rawPredict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rawPredict(request), expectedError); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.explain(request), expectedError); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.explain(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..5e250898 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts @@ -0,0 +1,3464 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecialistPools(request), expectedError); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..60e6bb98 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts @@ -0,0 +1,6677 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardExperiment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardRun(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardTimeSeries(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboards(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardExperiments(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..1983bc26 --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts @@ -0,0 +1,4631 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteStudy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTrial(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.stopTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOptimalTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.suggestTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.suggestTrials(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.checkTrialEarlyStoppingState(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listStudies(request), expectedError); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..c2413ad5 --- /dev/null +++ b/owl-bot-staging/v1beta1/package.json @@ -0,0 +1,79 @@ +{ + "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", + "deployment resource pool 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/ && minifyProtoJson", + "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": "^3.5.1" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.59", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.1", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.1", + "jsdoc-region-tag": "^2.0.1", + "linkinator": "^4.0.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.8.3", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} 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..5141dfa2 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.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/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/model_deployment_monitoring_job.proto"; +import "google/cloud/aiplatform/v1beta1/model_monitoring.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. + // + // The model resource name may contain version id or version alias to specify + // the version, if no version is specified, the default version will be used. + 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; + + // Model monitoring config will be used for analysis model behaviors, based on + // the input and output to the batch prediction job, as well as the provided + // training dataset. + ModelMonitoringConfig model_monitoring_config = 26; + + // Get batch prediction job monitoring statistics. + repeated ModelMonitoringStatsAnomalies model_monitoring_stats_anomalies = 31; + + // Output only. The running status of the model monitoring pipeline. + google.rpc.Status model_monitoring_status = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; +} 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..f784eda4 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto @@ -0,0 +1,48 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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]; + + // Output only. The number of the successful forecast points that are generated by the + // forecasting model. This is ONLY used by the forecasting batch prediction. + int64 successful_forecast_point_count = 5 [(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..ad66542d --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto @@ -0,0 +1,280 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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/env_var.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: 15 +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; + + // Optional. 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.field_behavior) = OPTIONAL, + (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; + + // 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/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..3be59c05 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto @@ -0,0 +1,461 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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/cloud/aiplatform/v1beta1/saved_query.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"; + } + + // Lists SavedQueries in a Dataset. + rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/savedQueries" + }; + 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.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries]. +message ListSavedQueriesRequest { + // Required. The resource name of the Dataset to list SavedQueries 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.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries]. +message ListSavedQueriesResponse { + // A list of SavedQueries that match the specified filter in the request. + repeated SavedQuery saved_queries = 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/deployment_resource_pool.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto new file mode 100644 index 00000000..2249e655 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto @@ -0,0 +1,50 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 = "DeploymentResourcePoolProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A description of resources that can be shared by multiple DeployedModels, +// whose underlying specification consists of a DedicatedResources. +message DeploymentResourcePool { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + pattern: "projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}" + }; + + // Output only. The resource name of the DeploymentResourcePool. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The underlying DedicatedResources that the DeploymentResourcePool uses. + DedicatedResources dedicated_resources = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this DeploymentResourcePool was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto new file mode 100644 index 00000000..11eddf67 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto @@ -0,0 +1,219 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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/deployed_model_ref.proto"; +import "google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto"; +import "google/cloud/aiplatform/v1beta1/endpoint.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.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 = "DeploymentResourcePoolServiceProto"; +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 manages the DeploymentResourcePool resource. +service DeploymentResourcePoolService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a DeploymentResourcePool. + rpc CreateDeploymentResourcePool(CreateDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" + body: "*" + }; + option (google.api.method_signature) = "parent,deployment_resource_pool,deployment_resource_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "DeploymentResourcePool" + metadata_type: "CreateDeploymentResourcePoolOperationMetadata" + }; + } + + // Get a DeploymentResourcePool. + rpc GetDeploymentResourcePool(GetDeploymentResourcePoolRequest) returns (DeploymentResourcePool) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List DeploymentResourcePools in a location. + rpc ListDeploymentResourcePools(ListDeploymentResourcePoolsRequest) returns (ListDeploymentResourcePoolsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a DeploymentResourcePool. + rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // List DeployedModels that have been deployed on this DeploymentResourcePool. + rpc QueryDeployedModels(QueryDeployedModelsRequest) returns (QueryDeployedModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{deployment_resource_pool=projects/*/locations/*/deploymentResourcePools/*}:queryDeployedModels" + }; + option (google.api.method_signature) = "deployment_resource_pool"; + } +} + +// Request message for CreateDeploymentResourcePool method. +message CreateDeploymentResourcePoolRequest { + // Required. The parent location resource where this DeploymentResourcePool will 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 DeploymentResourcePool to create. + DeploymentResourcePool deployment_resource_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the DeploymentResourcePool, which + // will become the final component of the DeploymentResourcePool's resource + // name. + // + // The maximum length is 63 characters, and valid characters + // are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + string deployment_resource_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for CreateDeploymentResourcePool method. +message CreateDeploymentResourcePoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for GetDeploymentResourcePool method. +message GetDeploymentResourcePoolRequest { + // Required. The name of the DeploymentResourcePool to retrieve. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + } + ]; +} + +// Request message for ListDeploymentResourcePools method. +message ListDeploymentResourcePoolsRequest { + // Required. The parent Location which owns this collection of DeploymentResourcePools. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of DeploymentResourcePools to return. The service may + // return fewer than this value. + int32 page_size = 2; + + // A page token, received from a previous `ListDeploymentResourcePools` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDeploymentResourcePools` must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for ListDeploymentResourcePools method. +message ListDeploymentResourcePoolsResponse { + // The DeploymentResourcePools from the specified location. + repeated DeploymentResourcePool deployment_resource_pools = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Runtime operation information for UpdateDeploymentResourcePool method. +message UpdateDeploymentResourcePoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for DeleteDeploymentResourcePool method. +message DeleteDeploymentResourcePoolRequest { + // Required. The name of the DeploymentResourcePool to delete. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + } + ]; +} + +// Request message for QueryDeployedModels method. +message QueryDeployedModelsRequest { + // Required. The name of the target DeploymentResourcePool to query. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string deployment_resource_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of DeployedModels to return. The service may return + // fewer than this value. + int32 page_size = 2; + + // A page token, received from a previous `QueryDeployedModels` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `QueryDeployedModels` must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for QueryDeployedModels method. +message QueryDeployedModelsResponse { + // DEPRECATED Use deployed_model_refs instead. + repeated DeployedModel deployed_models = 1 [deprecated = true]; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // References to the DeployedModels that share the specified + // deploymentResourcePool. + repeated DeployedModelRef deployed_model_refs = 3; +} 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..0236e532 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -0,0 +1,262 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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; + + // The resource name of the shared DeploymentResourcePool to deploy on. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string shared_resources = 17 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + }]; + } + + // 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 resource 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. + // + // The resource name may contain version id or version alias to specify the + // version, if no version is specified, the default version will be deployed. + 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..6dccd06e --- /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]; + + // Optional. Metadata describing the Model's input and output for explanation. + ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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_indices 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 + Presets presets = 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 Presets { + // 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..5f7cbd14 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -0,0 +1,273 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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"; + } + + // Writes Feature values of one or more entities of an EntityType. + // + // The Feature values are merged into existing entities if any. The Feature + // values to be written must have timestamp within the online storage + // retention. + rpc WriteFeatureValues(WriteFeatureValuesRequest) returns (WriteFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type,payloads"; + } +} + +// Request message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. +message WriteFeatureValuesRequest { + // Required. The resource name of the EntityType for the entities being written. + // Value format: `projects/{project}/locations/{location}/featurestores/ + // {featurestore}/entityTypes/{entityType}`. For example, + // for a machine learning model predicting user clicks on a website, an + // EntityType ID could be `user`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The entities to be written. Up to 100,000 feature values can be written + // across all `payloads`. + repeated WriteFeatureValuesPayload payloads = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains Feature values to be written for a specific entity. +message WriteFeatureValuesPayload { + // Required. The ID of the entity. + string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feature values to be written, mapping from Feature ID to value. Up to + // 100,000 `feature_values` entries may be written across all payloads. The + // feature generation time, aligned by days, must be no older than five + // years (1825 days) and no later than one year (366 days) in the future. + map feature_values = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. +message WriteFeatureValuesResponse { + +} + +// 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. +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..7deb3593 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto @@ -0,0 +1,1226 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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` + // * `online_serving_config.scaling` + 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..f0e3c67a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto @@ -0,0 +1,172 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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}" + }; + + // The update method of an Index. + enum IndexUpdateMethod { + // Should not be used. + INDEX_UPDATE_METHOD_UNSPECIFIED = 0; + + // BatchUpdate: user can call UpdateIndex with files on Cloud Storage of + // datapoints to update. + BATCH_UPDATE = 1; + + // StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update + // the Index and the updates will be applied in corresponding + // DeployedIndexes in nearly real-time. + STREAM_UPDATE = 2; + } + + // 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]; + + // Output only. Stats of the index resource. + IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be + // used by default. + IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; +} + +// A datapoint of Index. +message IndexDatapoint { + // Restriction of a datapoint which describe its attributes(tokens) from each + // of several attribute categories(namespaces). + message Restriction { + // The namespace of this restriction. eg: color. + string namespace = 1; + + // The attributes to allow in this namespace. eg: 'red' + repeated string allow_list = 2; + + // The attributes to deny in this namespace. eg: 'blue' + repeated string deny_list = 3; + } + + // Crowding tag is a constraint on a neighbor list produced by nearest + // neighbor search requiring that no more than some value k' of the k + // neighbors returned have the same value of crowding_attribute. + message CrowdingTag { + // The attribute value used for crowding. The maximum number of neighbors + // to return per crowding attribute value + // (per_crowding_attribute_num_neighbors) is configured per-query. This + // field is ignored if per_crowding_attribute_num_neighbors is larger than + // the total number of neighbors to return for a given query. + string crowding_attribute = 1; + } + + // Required. Unique identifier of the datapoint. + string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feature embedding vector. An array of numbers with the length of + // [NearestNeighborSearchConfig.dimensions]. + repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of Restrict of the datapoint, used to perform "restricted searches" + // where boolean rule are used to filter the subset of the database eligible + // for matching. + // See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering + repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CrowdingTag of the datapoint, the number of neighbors to return in each + // crowding can be configured during query. + CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Stats of the Index. +message IndexStats { + // Output only. The number of vectors in the Index. + int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of shards in the Index. + int32 shards_count = 2 [(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..813f648c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_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.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" + }; + } + + // Add/update Datapoints into an Index. + rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) { + option (google.api.http) = { + post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints" + body: "*" + }; + } + + // Remove Datapoints from an Index. + rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) { + option (google.api.http) = { + post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:removeDatapoints" + body: "*" + }; + } +} + +// 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" + } + ]; +} + +// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] +message UpsertDatapointsRequest { + // Required. The name of the Index resource to be updated. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string index = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // A list of datapoints to be created/updated. + repeated IndexDatapoint datapoints = 2; +} + +// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] +message UpsertDatapointsResponse { + +} + +// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] +message RemoveDatapointsRequest { + // Required. The name of the Index resource to be updated. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string index = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Index" + } + ]; + + // A list of datapoint ids to be deleted. + repeated string datapoint_ids = 2; +} + +// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] +message RemoveDatapointsResponse { + +} + +// 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..48cf08aa --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto @@ -0,0 +1,1008 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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 `=`, `!=` comparisons, and `:` wildcard. + // * `model_display_name` supports `=`, `!=` comparisons. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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. + // + // Supported fields: + // + // * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + // * `NOT display_name="my_job"` + // * `create_time>"2021-05-18T00:00:00Z"` + 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..5498d89d --- /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 64. + 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..ba9b2cd5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -0,0 +1,592 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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; + + // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1beta1.DeployedModel]. + // A pre-configured [DeploymentResourcePool][google.cloud.aiplatform.v1beta1.DeploymentResourcePool] is required. + SHARED_RESOURCES = 3; + } + + // 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..0446c1cc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto @@ -0,0 +1,310 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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]; + + // The time window of the prediction data being included in each prediction + // dataset. This window specifies how long the data should be collected from + // historical model results for each run. If not set, + // [ModelDeploymentMonitoringScheduleConfig.monitor_interval][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringScheduleConfig.monitor_interval] will be used. + // e.g. If currently the cutoff time is 2022-01-08 14:30:00 and the + // monitor_window is set to be 3600, then data from 2022-01-08 13:30:00 + // to 2022-01-08 14:30:00 will be retrieved and aggregated to calculate the + // monitoring statistics. + google.protobuf.Duration monitor_window = 2; +} + +// 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..3dc687e5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto @@ -0,0 +1,239 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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"; + +// The model monitoring configuration used for Batch Prediction Job. +message ModelMonitoringConfig { + // Model monitoring objective config. + repeated ModelMonitoringObjectiveConfig objective_configs = 3; + + // Model monitoring alert config. + ModelMonitoringAlertConfig alert_config = 2; + + // YAML schema file uri in Cloud Storage describing the format of a single + // instance that you want Tensorflow Data Validation (TFDV) to analyze. + // + // 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 = 4; + + // A Google Cloud Storage location for batch prediction model monitoring to + // dump statistics and anomalies. + // If not provided, a folder will be created in customer project to hold + // statistics and anomalies. + GcsDestination stats_anomalies_base_directory = 5; +} + +// The objective configuration for model monitoring, including the information +// needed to detect anomalies for one particular model. +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. + // "jsonl" + // The source file is a JSONL 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; + + // Skew anomaly detection threshold used by all features. + // When the per-feature thresholds are not set, this field can be used to + // specify a threshold for all features. + ThresholdConfig default_skew_threshold = 6; + } + + // 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; + + // Drift anomaly detection threshold used by all features. + // When the per-feature thresholds are not set, this field can be used to + // specify a threshold for all features. + ThresholdConfig default_drift_threshold = 5; + } + + // 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; +} + +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. +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. +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..1af9d4b4 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -0,0 +1,693 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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"; + } + + // Incrementally update the dataset used for an 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"; + } + + // Imports a list of externally generated ModelEvaluationSlice. + rpc BatchImportModelEvaluationSlices(BatchImportModelEvaluationSlicesRequest) returns (BatchImportModelEvaluationSlicesResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices:batchImport" + body: "*" + }; + option (google.api.method_signature) = "parent,model_evaluation_slices"; + } + + // 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-zA-Z0-9-]{0,126}[a-z-0-9]`. + // Add the `-` prefix to an alias means removing that alias from the version. + // `-` is NOT counted in the 128 characters. Example: `-golden` means removing + // the `golden` alias from the version. + // + // There is NO ordering in aliases, which means + // 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.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices] +message BatchImportModelEvaluationSlicesRequest { + // Required. The name of the parent ModelEvaluation resource. + // 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" + } + ]; + + // Required. Model evaluation slice resource to be imported. + repeated ModelEvaluationSlice model_evaluation_slices = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices] +message BatchImportModelEvaluationSlicesResponse { + // Output only. List of imported [ModelEvaluationSlice.name][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.name]. + repeated string imported_model_evaluation_slices = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// 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_failure_policy.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto new file mode 100644 index 00000000..f197f510 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.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; + +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 = "PipelineFailurePolicyProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Represents the failure policy of a pipeline. Currently, the default of a +// pipeline is that the pipeline will continue to run until no more tasks can be +// executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a +// pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling +// any new tasks when a task has failed. Any scheduled tasks will continue to +// completion. +enum PipelineFailurePolicy { + // Default value, and follows fail slow behavior. + PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0; + + // Indicates that the pipeline should continue to run until all possible + // tasks have been scheduled and completed. + PIPELINE_FAILURE_POLICY_FAIL_SLOW = 1; + + // Indicates that the pipeline should stop scheduling new tasks after a task + // has failed. + PIPELINE_FAILURE_POLICY_FAIL_FAST = 2; +} 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..9cb69a90 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto @@ -0,0 +1,349 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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_failure_policy.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; + + // Represents the failure policy of a pipeline. Currently, the default of a + // pipeline is that the pipeline will continue to run until no more tasks + // can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. + // However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it + // will stop scheduling any new tasks when a task has failed. Any scheduled + // tasks will continue to completion. + PipelineFailurePolicy failure_policy = 4; + } + + // 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..d66c7843 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto @@ -0,0 +1,405 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 `=`, `!=` comparisons, and `:` wildcard. + // * `state` supports `=`, `!=` comparisons. + // * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + // `create_time` must be in RFC 3339 format. + // + // Some examples of using the filter are: + // + // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + // * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + // * `NOT display_name="my_pipeline"` + // * `create_time>"2021-05-18T00:00:00Z"` + // * `training_task_definition:"*automl_text_classification*"` + 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`: 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/saved_query.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto new file mode 100644 index 00000000..da02d8a5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 = "SavedQueryProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A SavedQuery is a view of the dataset. It references a subset of annotations +// by problem type and filters. +message SavedQuery { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/SavedQuery" + pattern: "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}" + }; + + // Output only. Resource name of the SavedQuery. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The user-defined name of the SavedQuery. + // 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]; + + // Some additional information about the SavedQuery. + google.protobuf.Value metadata = 12; + + // Output only. Timestamp when this SavedQuery was created. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when SavedQuery was last updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Filters on the Annotations in the dataset. + string annotation_filter = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Problem type of the SavedQuery. + // Allowed values: + // + // * IMAGE_CLASSIFICATION_SINGLE_LABEL + // * IMAGE_CLASSIFICATION_MULTI_LABEL + // * IMAGE_BOUNDING_POLY + // * IMAGE_BOUNDING_BOX + // * TEXT_CLASSIFICATION_SINGLE_LABEL + // * TEXT_CLASSIFICATION_MULTI_LABEL + // * TEXT_EXTRACTION + // * TEXT_SENTIMENT + // * VIDEO_CLASSIFICATION + // * VIDEO_OBJECT_TRACKING + string problem_type = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Number of AnnotationSpecs in the context of the SavedQuery. + int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Used to perform a consistent read-modify-write update. If not set, a blind + // "overwrite" update happens. + string etag = 8; + + // Output only. If the Annotations belonging to the SavedQuery can be used for AutoML + // training. + bool support_automl_training = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} 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..249c5ca3 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto @@ -0,0 +1,230 @@ +// 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"; + +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..5a4b9767 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto @@ -0,0 +1,42 @@ +// 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"; + +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..6f8b3eff --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.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; + +import "google/api/field_behavior.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..d35bbc33 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto @@ -0,0 +1,126 @@ +// 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; + + +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..5dd708e3 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.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; + + +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..7ce0a344 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.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.instance; + + +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..b92db336 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.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.instance; + + +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..a83b7fbc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto @@ -0,0 +1,38 @@ +// 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; + + +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..99b8deda --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/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.predict.instance; + + +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..0265e4c0 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.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; + + +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..17480d0c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/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.instance; + + +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..f65c6d2b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto @@ -0,0 +1,50 @@ +// 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; + + +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..9261a240 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto @@ -0,0 +1,50 @@ +// 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; + + +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..6a420074 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto @@ -0,0 +1,50 @@ +// 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; + + +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..088f0495 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_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.params; + + +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..32861f2b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.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.params; + + +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..a49c8136 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto @@ -0,0 +1,35 @@ +// 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; + + +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..02e8ec9f --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.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.params; + + +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..c93ccb6b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto @@ -0,0 +1,63 @@ +// 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; + + +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..25c91dd7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto @@ -0,0 +1,42 @@ +// 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; + + +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..b7b6d3db --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto @@ -0,0 +1,40 @@ +// 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; + + +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..a5489b1b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto @@ -0,0 +1,50 @@ +// 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"; + +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..77629ccf --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto @@ -0,0 +1,44 @@ +// 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; + + +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..1616dfca --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_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.prediction; + + +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..0aa04bdd --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.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.prediction; + + +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..e7c0cffc --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.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; + + +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..b5b7a145 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.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.v1beta1.schema.predict.prediction; + + +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..e2db5812 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto @@ -0,0 +1,32 @@ +// 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; + + +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..86ff341c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto @@ -0,0 +1,53 @@ +// 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"; + +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..6cff9762 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto @@ -0,0 +1,66 @@ +// 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"; + +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..11e28a9a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto @@ -0,0 +1,81 @@ +// 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"; + +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..1b874b03 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.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.trainingjob.definition; + + +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..938ece40 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto @@ -0,0 +1,119 @@ +// 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; + + +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..e368e00b --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto @@ -0,0 +1,105 @@ +// 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; + + +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..5488f747 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto @@ -0,0 +1,283 @@ +// 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"; + +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..b57492a5 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.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.v1beta1.schema.trainingjob.definition; + + +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..a367486a --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.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.v1beta1.schema.trainingjob.definition; + + +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..b63162d7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.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; + + +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..596d0abd --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto @@ -0,0 +1,286 @@ +// 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"; + +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..ef5284b7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto @@ -0,0 +1,61 @@ +// 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; + + +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..c6e15229 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto @@ -0,0 +1,55 @@ +// 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; + + +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..7d929d20 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto @@ -0,0 +1,66 @@ +// 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; + + +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..b88d0c4f --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto @@ -0,0 +1,42 @@ +// 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; + + +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_saved_queries.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.upsert_datapoints.jsinclude:samples/generated/v1/index_service.remove_datapoints.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.merge_version_aliases.jsinclude:samples/generated/v1/model_service.import_model_evaluation.jsinclude:samples/generated/v1/model_service.batch_import_model_evaluation_slices.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.delete_model_version.jsinclude:samples/generated/v1/model_service.delete_model_version.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_versions.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..b2595c68 --- /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 HyperparameterTuningJob 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 HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported + // by HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported + // by HyperparameterTuningJob 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 + // HyperparameterTuningJob 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..138fbc3c --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto @@ -0,0 +1,413 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDataset, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataset, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importData, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportData, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SavedQueries 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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery}. + * 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 `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueries( + request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISavedQuery[], + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse + ]>; + listSavedQueries( + request: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): void; + listSavedQueries( + request: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): void; + listSavedQueries( + request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISavedQuery>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.ISavedQuery[], + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSavedQueries(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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery} 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 `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSavedQueriesStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.createStream( + this.innerApiCalls.listSavedQueries as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSavedQueries`, 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 SavedQueries 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 + * [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery}. 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_ListSavedQueries_async + */ + listSavedQueriesAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.asyncIterate( + this.innerApiCalls['listSavedQueries'] as GaxCall, + request as {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..6ddf573c --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json @@ -0,0 +1,80 @@ +{ + "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" + }, + "ListSavedQueries": { + "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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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/deployment_resource_pool_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts new file mode 100644 index 00000000..2d6975bf --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts @@ -0,0 +1,3556 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/deployment_resource_pool_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './deployment_resource_pool_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service that manages the DeploymentResourcePool resource. + * @class + * @memberof v1beta1 + */ +export class DeploymentResourcePoolServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + deploymentResourcePoolServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DeploymentResourcePoolServiceClient. + * + * @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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DeploymentResourcePoolServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DeploymentResourcePoolServiceClient; + 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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 = { + listDeploymentResourcePools: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deploymentResourcePools'), + queryDeployedModels: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployedModels') + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createDeploymentResourcePoolResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeploymentResourcePool') as gax.protobuf.Type; + const createDeploymentResourcePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolOperationMetadata') as gax.protobuf.Type; + const deleteDeploymentResourcePoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteDeploymentResourcePoolMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDeploymentResourcePoolResponse.decode.bind(createDeploymentResourcePoolResponse), + createDeploymentResourcePoolMetadata.decode.bind(createDeploymentResourcePoolMetadata)), + deleteDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDeploymentResourcePoolResponse.decode.bind(deleteDeploymentResourcePoolResponse), + deleteDeploymentResourcePoolMetadata.decode.bind(deleteDeploymentResourcePoolMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService', 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 = this._gaxModule.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.deploymentResourcePoolServiceStub) { + return this.deploymentResourcePoolServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService. + this.deploymentResourcePoolServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService, + 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 deploymentResourcePoolServiceStubMethods = + ['createDeploymentResourcePool', 'getDeploymentResourcePool', 'listDeploymentResourcePools', 'deleteDeploymentResourcePool', 'queryDeployedModels']; + for (const methodName of deploymentResourcePoolServiceStubMethods) { + const callPromise = this.deploymentResourcePoolServiceStub.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._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.deploymentResourcePoolServiceStub; + } + + /** + * 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 -- + // ------------------- +/** + * Get a DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DeploymentResourcePool to retrieve. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. + * Please see 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_DeploymentResourcePoolService_GetDeploymentResourcePool_async + */ + getDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|undefined, {}|undefined + ]>; + getDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, + {}|null|undefined>): void; + getDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, + {}|null|undefined>): void; + getDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, + protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDeploymentResourcePool(request, options, callback); + } + +/** + * Create a DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent location resource where this DeploymentResourcePool will be + * created. Format: projects/{project}/locations/{location} + * @param {google.cloud.aiplatform.v1beta1.DeploymentResourcePool} request.deploymentResourcePool + * Required. The DeploymentResourcePool to create. + * @param {string} request.deploymentResourcePoolId + * Required. The ID to use for the DeploymentResourcePool, which + * will become the final component of the DeploymentResourcePool's resource + * name. + * + * The maximum length is 63 characters, and valid characters + * are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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_DeploymentResourcePoolService_CreateDeploymentResourcePool_async + */ + createDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createDeploymentResourcePool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createDeploymentResourcePool()`. + * @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_DeploymentResourcePoolService_CreateDeploymentResourcePool_async + */ + async checkCreateDeploymentResourcePoolProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDeploymentResourcePool, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Delete a DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DeploymentResourcePool to delete. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_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 + * 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_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async + */ + deleteDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDeploymentResourcePool( + request: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteDeploymentResourcePool( + request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteDeploymentResourcePool(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteDeploymentResourcePool()`. + * @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_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async + */ + async checkDeleteDeploymentResourcePoolProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDeploymentResourcePool, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * List DeploymentResourcePools in a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent Location which owns this collection of DeploymentResourcePools. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * The maximum number of DeploymentResourcePools to return. The service may + * return fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeploymentResourcePools` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDeploymentResourcePools` 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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. + * 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 `listDeploymentResourcePoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeploymentResourcePools( + request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[], + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse + ]>; + listDeploymentResourcePools( + request: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): void; + listDeploymentResourcePools( + request: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): void; + listDeploymentResourcePools( + request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[], + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listDeploymentResourcePools(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 Location which owns this collection of DeploymentResourcePools. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * The maximum number of DeploymentResourcePools to return. The service may + * return fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeploymentResourcePools` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDeploymentResourcePools` 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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool} 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 `listDeploymentResourcePoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDeploymentResourcePoolsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDeploymentResourcePools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeploymentResourcePools.createStream( + this.innerApiCalls.listDeploymentResourcePools as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDeploymentResourcePools`, 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 Location which owns this collection of DeploymentResourcePools. + * Format: projects/{project}/locations/{location} + * @param {number} request.pageSize + * The maximum number of DeploymentResourcePools to return. The service may + * return fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `ListDeploymentResourcePools` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDeploymentResourcePools` 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 + * [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. 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_DeploymentResourcePoolService_ListDeploymentResourcePools_async + */ + listDeploymentResourcePoolsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDeploymentResourcePools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDeploymentResourcePools.asyncIterate( + this.innerApiCalls['listDeploymentResourcePools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List DeployedModels that have been deployed on this DeploymentResourcePool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.deploymentResourcePool + * Required. The name of the target DeploymentResourcePool to query. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @param {number} request.pageSize + * The maximum number of DeployedModels to return. The service may return + * fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `QueryDeployedModels` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `QueryDeployedModels` 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 [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel}. + * 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 `queryDeployedModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDeployedModels( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeployedModel[], + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse + ]>; + queryDeployedModels( + request: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): void; + queryDeployedModels( + request: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): void; + queryDeployedModels( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeployedModel>, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, + protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IDeployedModel[], + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest|null, + protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'deployment_resource_pool': request.deploymentResourcePool ?? '', + }); + this.initialize(); + return this.innerApiCalls.queryDeployedModels(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.deploymentResourcePool + * Required. The name of the target DeploymentResourcePool to query. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @param {number} request.pageSize + * The maximum number of DeployedModels to return. The service may return + * fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `QueryDeployedModels` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `QueryDeployedModels` 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 [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel} 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 `queryDeployedModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDeployedModelsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'deployment_resource_pool': request.deploymentResourcePool ?? '', + }); + const defaultCallSettings = this._defaults['queryDeployedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDeployedModels.createStream( + this.innerApiCalls.queryDeployedModels as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryDeployedModels`, 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.deploymentResourcePool + * Required. The name of the target DeploymentResourcePool to query. + * Format: + * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + * @param {number} request.pageSize + * The maximum number of DeployedModels to return. The service may return + * fewer than this value. + * @param {string} request.pageToken + * A page token, received from a previous `QueryDeployedModels` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `QueryDeployedModels` 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 + * [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel}. 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_DeploymentResourcePoolService_QueryDeployedModels_async + */ + queryDeployedModelsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'deployment_resource_pool': request.deploymentResourcePool ?? '', + }); + const defaultCallSettings = this._defaults['queryDeployedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDeployedModels.asyncIterate( + this.innerApiCalls['queryDeployedModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.deploymentResourcePoolServiceStub && !this._terminated) { + return this.deploymentResourcePoolServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json new file mode 100644 index 00000000..060fe052 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService": { + "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": { + "CreateDeploymentResourcePool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDeploymentResourcePool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDeploymentResourcePools": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDeploymentResourcePool": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryDeployedModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json new file mode 100644 index 00000000..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..f21ab074 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts @@ -0,0 +1,3681 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new EndpointServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployModel, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployModel, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..b3f6a1d9 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts @@ -0,0 +1,3032 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FeaturestoreOnlineServingServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + + this.descriptors.longrunning = { + }; + + // 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 = this._gaxModule.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', 'writeFeatureValues']; + 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 this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity_type': request.entityType ?? '', + }); + this.initialize(); + return this.innerApiCalls.readFeatureValues(request, options, callback); + } +/** + * Writes Feature values of one or more entities of an EntityType. + * + * The Feature values are merged into existing entities if any. The Feature + * values to be written must have timestamp within the online storage + * retention. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.entityType + * Required. The resource name of the EntityType for the entities being written. + * Value format: `projects/{project}/locations/{location}/featurestores/ + * {featurestore}/entityTypes/{entityType}`. For example, + * for a machine learning model predicting user clicks on a website, an + * EntityType ID could be `user`. + * @param {number[]} request.payloads + * Required. The entities to be written. Up to 100,000 feature values can be written + * across all `payloads`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse}. + * Please see 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_WriteFeatureValues_async + */ + writeFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|undefined, {}|undefined + ]>; + writeFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + writeFeatureValues( + request: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): void; + writeFeatureValues( + request?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, + protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity_type': request.entityType ?? '', + }); + this.initialize(); + return this.innerApiCalls.writeFeatureValues(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' + ] = this._gaxModule.routingHeader.fromParams({ + 'entity_type': request.entityType ?? '', + }); + this.initialize(); + return this.innerApiCalls.streamingReadFeatureValues(request, options); + } + +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.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..bbe56dc0 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json @@ -0,0 +1,40 @@ +{ + "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" + }, + "WriteFeatureValues": { + "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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..65342472 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts @@ -0,0 +1,5858 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FeaturestoreServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeaturestore, this._gaxModule.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` + * * `online_serving_config.scaling` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFeaturestore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEntityType, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEntityType, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeature, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeature, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportFeatureValues, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..e3e19f14 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,2369 @@ +{ + "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" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "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" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "ListAnnotations": { + "methods": [ + "listAnnotations", + "listAnnotationsStream", + "listAnnotationsAsync" + ] + } + } + } + } + }, + "DeploymentResourcePoolService": { + "clients": { + "grpc": { + "libraryClient": "DeploymentResourcePoolServiceClient", + "rpcs": { + "GetDeploymentResourcePool": { + "methods": [ + "getDeploymentResourcePool" + ] + }, + "CreateDeploymentResourcePool": { + "methods": [ + "createDeploymentResourcePool" + ] + }, + "DeleteDeploymentResourcePool": { + "methods": [ + "deleteDeploymentResourcePool" + ] + }, + "ListDeploymentResourcePools": { + "methods": [ + "listDeploymentResourcePools", + "listDeploymentResourcePoolsStream", + "listDeploymentResourcePoolsAsync" + ] + }, + "QueryDeployedModels": { + "methods": [ + "queryDeployedModels", + "queryDeployedModelsStream", + "queryDeployedModelsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DeploymentResourcePoolServiceClient", + "rpcs": { + "GetDeploymentResourcePool": { + "methods": [ + "getDeploymentResourcePool" + ] + }, + "CreateDeploymentResourcePool": { + "methods": [ + "createDeploymentResourcePool" + ] + }, + "DeleteDeploymentResourcePool": { + "methods": [ + "deleteDeploymentResourcePool" + ] + }, + "ListDeploymentResourcePools": { + "methods": [ + "listDeploymentResourcePools", + "listDeploymentResourcePoolsStream", + "listDeploymentResourcePoolsAsync" + ] + }, + "QueryDeployedModels": { + "methods": [ + "queryDeployedModels", + "queryDeployedModelsStream", + "queryDeployedModelsAsync" + ] + } + } + } + } + }, + "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" + ] + }, + "WriteFeatureValues": { + "methods": [ + "writeFeatureValues" + ] + }, + "StreamingReadFeatureValues": { + "methods": [ + "streamingReadFeatureValues" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FeaturestoreOnlineServingServiceClient", + "rpcs": { + "ReadFeatureValues": { + "methods": [ + "readFeatureValues" + ] + }, + "WriteFeatureValues": { + "methods": [ + "writeFeatureValues" + ] + } + } + } + } + }, + "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" + ] + }, + "UpsertDatapoints": { + "methods": [ + "upsertDatapoints" + ] + }, + "RemoveDatapoints": { + "methods": [ + "removeDatapoints" + ] + }, + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "UpdateIndex": { + "methods": [ + "updateIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes", + "listIndexesStream", + "listIndexesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "IndexServiceClient", + "rpcs": { + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "UpsertDatapoints": { + "methods": [ + "upsertDatapoints" + ] + }, + "RemoveDatapoints": { + "methods": [ + "removeDatapoints" + ] + }, + "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" + ] + }, + "BatchImportModelEvaluationSlices": { + "methods": [ + "batchImportModelEvaluationSlices" + ] + }, + "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" + ] + }, + "BatchImportModelEvaluationSlices": { + "methods": [ + "batchImportModelEvaluationSlices" + ] + }, + "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..838f2630 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,34 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 {DeploymentResourcePoolServiceClient} from './deployment_resource_pool_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..8644a241 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts @@ -0,0 +1,3765 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new IndexEndpointServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..304bcd51 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts @@ -0,0 +1,3581 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new IndexServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'upsertDatapoints', 'removeDatapoints']; + 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._opts.fallback + ); + + 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' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getIndex(request, options, callback); + } +/** + * Add/update Datapoints into an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.index + * Required. The name of the Index resource to be updated. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {number[]} request.datapoints + * A list of datapoints to be created/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 [UpsertDatapointsResponse]{@link google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse}. + * Please see 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_UpsertDatapoints_async + */ + upsertDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|undefined, {}|undefined + ]>; + upsertDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): void; + upsertDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): void; + upsertDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'index': request.index ?? '', + }); + this.initialize(); + return this.innerApiCalls.upsertDatapoints(request, options, callback); + } +/** + * Remove Datapoints from an Index. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.index + * Required. The name of the Index resource to be updated. + * Format: + * `projects/{project}/locations/{location}/indexes/{index}` + * @param {string[]} request.datapointIds + * A list of datapoint ids to 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 [RemoveDatapointsResponse]{@link google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse}. + * Please see 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_RemoveDatapoints_async + */ + removeDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|undefined, {}|undefined + ]>; + removeDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): void; + removeDatapoints( + request: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): void; + removeDatapoints( + request?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, + protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'index': request.index ?? '', + }); + this.initialize(); + return this.innerApiCalls.removeDatapoints(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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateIndex, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndex, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..18cb2461 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json @@ -0,0 +1,59 @@ +{ + "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" + }, + "UpsertDatapoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDatapoints": { + "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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..dd4c8d0e --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts @@ -0,0 +1,6139 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new JobServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `model_display_name` supports `=`, `!=` comparisons. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 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. + * + * Supported fields: + * + * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` + * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` + * * `NOT display_name="my_job"` + * * `create_time>"2021-05-18T00:00:00Z"` + * @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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..74329eb0 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts @@ -0,0 +1,6464 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MetadataServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMetadataStore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteArtifact, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeArtifacts, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteContext, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeContexts, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeExecutions, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..14f62ebc --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts @@ -0,0 +1,3189 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MigrationServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchMigrateResources, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..58e52548 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts @@ -0,0 +1,4812 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ModelServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'batchImportModelEvaluationSlices', '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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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-zA-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' + ] = this._gaxModule.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.importModelEvaluation(request, options, callback); + } +/** + * Imports a list of externally generated ModelEvaluationSlice. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the parent ModelEvaluation resource. + * Format: + * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` + * @param {number[]} request.modelEvaluationSlices + * Required. Model evaluation slice 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 [BatchImportModelEvaluationSlicesResponse]{@link google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse}. + * Please see 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_BatchImportModelEvaluationSlices_async + */ + batchImportModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined + ]>; + batchImportModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): void; + batchImportModelEvaluationSlices( + request: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): void; + batchImportModelEvaluationSlices( + request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, + protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchImportModelEvaluationSlices(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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.uploadModel, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Incrementally update the dataset used for an 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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateExplanationDataset, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModel, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelVersion, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportModel, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..e467c45b --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json @@ -0,0 +1,100 @@ +{ + "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" + }, + "BatchImportModelEvaluationSlices": { + "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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..8c0d6da1 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts @@ -0,0 +1,4103 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PipelineServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePipelineJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. + * * `state` supports `=`, `!=` comparisons. + * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. + * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. + * `create_time` must be in RFC 3339 format. + * + * Some examples of using the filter are: + * + * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` + * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` + * * `NOT display_name="my_pipeline"` + * * `create_time>"2021-05-18T00:00:00Z"` + * * `training_task_definition:"*automl_text_classification*"` + * @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' + ] = this._gaxModule.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 {}, + 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`: 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' + ] = this._gaxModule.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`: 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' + ] = this._gaxModule.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 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`: 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..c3c466e6 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts @@ -0,0 +1,3097 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PredictionServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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}' + ), + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + + this.descriptors.longrunning = { + }; + + // 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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.routingHeader.fromParams({ + 'endpoint': request.endpoint ?? '', + }); + this.initialize(); + return this.innerApiCalls.explain(request, options, callback); + } + +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..79c3d47d --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts @@ -0,0 +1,3430 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SpecialistPoolServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..7fd77dbf --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts @@ -0,0 +1,5933 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform, 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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TensorboardServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') + }; + + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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 this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboard, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..677e44d4 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts @@ -0,0 +1,4260 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +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'; +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}; + iamClient: IamClient; + locationsClient: LocationsClient; + 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new VizierServiceClient({fallback: 'rest'}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // 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; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // 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}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + 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}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + 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. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], + },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback + ); + + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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. It must be positive. + * @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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.suggestTrials, this._gaxModule.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' + ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, this._gaxModule.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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + 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' + ] = this._gaxModule.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' + ] = this._gaxModule.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 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' + ] = this._gaxModule.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 {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the 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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. 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 + * The resource that owns the locations collection, if applicable. + * @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 {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 + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; + } + + /** + * 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 savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; + } + + /** + * 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.iamClient.close(); + this.locationsClient.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..574e74be --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json @@ -0,0 +1,121 @@ +[ + "../../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/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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..84abc66e --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js @@ -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 +// +// 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 deploymentResourcePoolServiceClient = new aiplatform.DeploymentResourcePoolServiceClient(); + 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..764393ae --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,122 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, DeploymentResourcePoolServiceClient, 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 doStuffWithDeploymentResourcePoolServiceClient(client: DeploymentResourcePoolServiceClient) { + 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 deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); + doStuffWithDeploymentResourcePoolServiceClient(deploymentResourcePoolServiceClient); + // 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..557a5755 --- /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..af021883 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts @@ -0,0 +1,4615 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); + request.dataset.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAnnotationSpec(request), expectedError); + const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDatasetRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDatasets(request), expectedError); + const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDatasetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataItems(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataItemsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSavedQueries', () => { + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); + const [response] = await client.listSavedQueries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSavedQueries( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSavedQueries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSavedQueries(request), expectedError); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SavedQuery) => { + 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.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SavedQuery) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[] = []; + const iterable = client.listSavedQueriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSavedQueriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAnnotations(request), expectedError); + const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListAnnotationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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_deployment_resource_pool_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts new file mode 100644 index 00000000..c9a64529 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -0,0 +1,3627 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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 deploymentresourcepoolserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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.DeploymentResourcePoolServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentResourcePoolServiceStub, undefined); + await client.initialize(); + assert(client.deploymentResourcePoolServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.deploymentResourcePoolServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.deploymentResourcePoolServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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('getDeploymentResourcePool', () => { + it('invokes getDeploymentResourcePool without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() + ); + client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall(expectedResponse); + const [response] = await client.getDeploymentResourcePool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeploymentResourcePool without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() + ); + client.innerApiCalls.getDeploymentResourcePool = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDeploymentResourcePool( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeploymentResourcePool with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDeploymentResourcePool(request), expectedError); + const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDeploymentResourcePool with closed client', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDeploymentResourcePool(request), expectedError); + }); + }); + + describe('createDeploymentResourcePool', () => { + it('invokes createDeploymentResourcePool without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(expectedResponse); + const [operation] = await client.createDeploymentResourcePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeploymentResourcePool without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDeploymentResourcePool( + 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); + const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeploymentResourcePool with call error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createDeploymentResourcePool(request), expectedError); + const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDeploymentResourcePool with LRO error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createDeploymentResourcePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateDeploymentResourcePoolProgress without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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.checkCreateDeploymentResourcePoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDeploymentResourcePoolProgress with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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.checkCreateDeploymentResourcePoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteDeploymentResourcePool', () => { + it('invokes deleteDeploymentResourcePool without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDeploymentResourcePool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeploymentResourcePool without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDeploymentResourcePool( + 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); + const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeploymentResourcePool with call error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDeploymentResourcePool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDeploymentResourcePool with LRO error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDeploymentResourcePool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteDeploymentResourcePoolProgress without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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.checkDeleteDeploymentResourcePoolProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDeploymentResourcePoolProgress with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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.checkDeleteDeploymentResourcePoolProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listDeploymentResourcePools', () => { + it('invokes listDeploymentResourcePools without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + ]; + client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall(expectedResponse); + const [response] = await client.listDeploymentResourcePools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentResourcePools without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + ]; + client.innerApiCalls.listDeploymentResourcePools = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDeploymentResourcePools( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentResourcePools with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDeploymentResourcePools(request), expectedError); + const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDeploymentResourcePoolsStream without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + ]; + client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDeploymentResourcePoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool) => { + 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.listDeploymentResourcePools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeploymentResourcePools, request)); + assert( + (client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDeploymentResourcePoolsStream with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDeploymentResourcePoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDeploymentResourcePools, request)); + assert( + (client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeploymentResourcePools without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), + ]; + client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[] = []; + const iterable = client.listDeploymentResourcePoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDeploymentResourcePools with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDeploymentResourcePoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('queryDeployedModels', () => { + it('invokes queryDeployedModels without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + ]; + client.innerApiCalls.queryDeployedModels = stubSimpleCall(expectedResponse); + const [response] = await client.queryDeployedModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDeployedModels without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + ]; + client.innerApiCalls.queryDeployedModels = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryDeployedModels( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDeployedModels with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryDeployedModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryDeployedModels(request), expectedError); + const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDeployedModelsStream without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + ]; + client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryDeployedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DeployedModel[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeployedModel) => { + 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.queryDeployedModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDeployedModels, request)); + assert( + (client.descriptors.page.queryDeployedModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes queryDeployedModelsStream with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryDeployedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.DeployedModel[] = []; + stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeployedModel) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryDeployedModels.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDeployedModels, request)); + assert( + (client.descriptors.page.queryDeployedModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with queryDeployedModels without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), + ]; + client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[] = []; + const iterable = client.queryDeployedModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with queryDeployedModels with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryDeployedModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ + 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..22e4aea9 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts @@ -0,0 +1,3772 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); + request.endpoint.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployModel(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployModelRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEndpoints(request), expectedError); + const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..adef8d9f --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -0,0 +1,2937 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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 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.FeaturestoreOnlineServingServiceClient', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readFeatureValues(request), expectedError); + }); + }); + + describe('writeFeatureValues', () => { + it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() + ); + client.innerApiCalls.writeFeatureValues = stubSimpleCall(expectedResponse); + const [response] = await client.writeFeatureValues(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() + ); + client.innerApiCalls.writeFeatureValues = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeFeatureValues( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeFeatureValues = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeFeatureValues(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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + 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('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..e9c06ed0 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts @@ -0,0 +1,5947 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeaturestoreRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetEntityTypeRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); + request.entityType.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); + request.feature.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeaturestore(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeaturestore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createEntityType(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteEntityType(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteEntityType(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateFeatureRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFeature(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchCreateFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchCreateFeatures(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFeature(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFeature(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.importFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.importFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchReadFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchReadFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportFeatureValues(request), expectedError); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportFeatureValues(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeaturestores(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listEntityTypes(request), expectedError); + const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListEntityTypesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListFeaturesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchFeatures(request), expectedError); + const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchFeaturesRequest', ['location']); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; + 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( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..799d096b --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts @@ -0,0 +1,3926 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexEndpointRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); + request.indexEndpoint.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndexEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndexEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deployIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deployIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.undeployIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.undeployIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.mutateDeployedIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.mutateDeployedIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexEndpoints(request), expectedError); + const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..ba38c283 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts @@ -0,0 +1,3726 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getIndex(request), expectedError); + }); + }); + + describe('upsertDatapoints', () => { + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() + ); + client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); + const [response] = await client.upsertDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() + ); + client.innerApiCalls.upsertDatapoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upsertDatapoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.upsertDatapoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.upsertDatapoints(request), expectedError); + const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes upsertDatapoints 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.UpsertDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('UpsertDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.upsertDatapoints(request), expectedError); + }); + }); + + describe('removeDatapoints', () => { + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() + ); + client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); + const [response] = await client.removeDatapoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() + ); + client.innerApiCalls.removeDatapoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDatapoints( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDatapoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDatapoints(request), expectedError); + const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes removeDatapoints 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.RemoveDatapointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('RemoveDatapointsRequest', ['index']); + request.index = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeDatapoints(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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateIndexRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteIndex(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteIndex(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listIndexes(request), expectedError); + const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListIndexesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new indexserviceModule.v1beta1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..e06dc505 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts @@ -0,0 +1,6817 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateCustomJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetCustomJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelCustomJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelCustomJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelDataLabelingJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelHyperparameterTuningJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelBatchPredictionJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.pauseModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); + const [response] = await client.resumeModelDeploymentMonitoringJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCustomJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteCustomJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCustomJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteDataLabelingJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteDataLabelingJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteHyperparameterTuningJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBatchPredictionJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelDeploymentMonitoringJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCustomJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListCustomJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBatchPredictionJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); + const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + 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( + (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new jobserviceModule.v1beta1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..65f345da --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts @@ -0,0 +1,7134 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataStoreRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateArtifactRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); + request.artifact.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createContext(request), expectedError); + const actualRequest = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateContextRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getContext(request), expectedError); + const actualRequest = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateContext(request), expectedError); + const actualRequest = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); + request.context.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addContextChildren(request), expectedError); + const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddContextChildrenRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); + const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); + request.context = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateExecutionRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetExecutionRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); + request.execution.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addExecutionEvents(request), expectedError); + const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); + request.execution = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); + const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); + request.execution = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createMetadataSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMetadataSchema(request), expectedError); + const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); + const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); + request.artifact = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMetadataStore(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMetadataStore(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteArtifact(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteArtifact(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeArtifacts(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeArtifacts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteContext(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteContext(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeContexts(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeContexts(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteExecution(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteExecutionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteExecution(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.purgeExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.purgeExecutions(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataStores(request), expectedError); + const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listArtifacts(request), expectedError); + const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListArtifactsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listContexts(request), expectedError); + const actualRequest = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListContextsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listExecutions(request), expectedError); + const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListExecutionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMetadataSchemas(request), expectedError); + const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..520a65b5 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts @@ -0,0 +1,3090 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.batchMigrateResources(request), expectedError); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.batchMigrateResources(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchMigratableResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..1f4a1a43 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts @@ -0,0 +1,5201 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateModel(request), expectedError); + const actualRequest = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); + request.model.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.mergeVersionAliases(request), expectedError); + const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.importModelEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.importModelEvaluation(request), expectedError); + }); + }); + + describe('batchImportModelEvaluationSlices', () => { + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() + ); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(expectedResponse); + const [response] = await client.batchImportModelEvaluationSlices(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() + ); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchImportModelEvaluationSlices( + request, + (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchImportModelEvaluationSlices(request), expectedError); + const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchImportModelEvaluationSlices(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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluation(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModelEvaluationSlice(request), expectedError); + const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.uploadModel(request), expectedError); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UploadModelRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.uploadModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateExplanationDataset(request), expectedError); + const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateExplanationDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModel(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteModelVersion(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteModelVersionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteModelVersion(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportModel(request), expectedError); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModels(request), expectedError); + const actualRequest = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelVersions(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelVersionsRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluations(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listModelEvaluationSlices(request), expectedError); + const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..ae08169f --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts @@ -0,0 +1,4137 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); + const [response] = await client.cancelTrainingPipeline(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetPipelineJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelPipelineJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelPipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CancelPipelineJobRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTrainingPipeline(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTrainingPipeline(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deletePipelineJob(request), expectedError); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeletePipelineJobRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deletePipelineJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrainingPipelines(request), expectedError); + const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listPipelineJobs(request), expectedError); + const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..83384f6d --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts @@ -0,0 +1,2934 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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 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.PredictionServiceClient', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); + const [response] = await client.rawPredict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rawPredict(request), expectedError); + const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('RawPredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.explain(request), expectedError); + const actualRequest = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.explain(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..c9cbcef1 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts @@ -0,0 +1,3510 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSpecialistPool(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSpecialistPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSpecialistPools(request), expectedError); + const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..a146d7f1 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts @@ -0,0 +1,6723 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); + request.tensorboardExperiment.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardRunRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); + request.tensorboardRun.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); + request.tensorboardTimeSeries.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); + request.tensorboard = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); + const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); + request.tensorboardExperiment = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeTensorboardRunData(request), expectedError); + const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); + request.tensorboardRun = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTensorboardRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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 ??= {}; + const defaultValue1 = + getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboard(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboard(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardExperiment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardRun(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardRun(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTensorboardTimeSeries(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); + request.timeSeries = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboards(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardExperiments(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardRuns(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); + const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); + const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + 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( + (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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..a13e1af5 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts @@ -0,0 +1,4677 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.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, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +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', () => { + describe('Common methods', () => { + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateStudyRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteStudy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookupStudy(request), expectedError); + const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('LookupStudyRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CreateTrialRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addTrialMeasurement(request), expectedError); + const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); + request.trialName = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.completeTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CompleteTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTrial(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.stopTrial(request), expectedError); + const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listOptimalTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); + request.parent = defaultValue1; + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.suggestTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('SuggestTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.suggestTrials(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + 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); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.checkTrialEarlyStoppingState(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listStudies(request), expectedError); + const actualRequest = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListStudiesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTrials(request), expectedError); + const actualRequest = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + 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() + ); + const defaultValue1 = + getTypeDefaultValue('ListTrialsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + 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('deploymentResourcePool', () => { + const fakePath = "/rendered/path/deploymentResourcePool"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + deployment_resource_pool: "deploymentResourcePoolValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, "deploymentResourcePoolValue"); + assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { + const fakePath = "/rendered/path/savedQuery"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dataset: "datasetValue", + saved_query: "savedQueryValue", + }; + const client = new vizierserviceModule.v1beta1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, "datasetValue"); + assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.savedQueryPathTemplate.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 30800b0c654d9fbd8afdcdeea4f78ee9aadb336c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 14 Sep 2022 22:00:29 +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 | 292 - .../aiplatform/v1/completion_stats.proto | 48 - .../google/cloud/aiplatform/v1/context.proto | 94 - .../cloud/aiplatform/v1/custom_job.proto | 280 - .../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 | 461 - .../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 | 258 - .../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 | 461 - .../aiplatform/v1/explanation_metadata.proto | 398 - .../google/cloud/aiplatform/v1/feature.proto | 154 - .../v1/feature_monitoring_stats.proto | 86 - .../aiplatform/v1/feature_selector.proto | 44 - .../cloud/aiplatform/v1/featurestore.proto | 129 - .../v1/featurestore_monitoring.proto | 149 - .../v1/featurestore_online_service.proto | 224 - .../aiplatform/v1/featurestore_service.proto | 1226 --- .../v1/hyperparameter_tuning_job.proto | 110 - .../google/cloud/aiplatform/v1/index.proto | 172 - .../cloud/aiplatform/v1/index_endpoint.proto | 245 - .../v1/index_endpoint_service.proto | 335 - .../cloud/aiplatform/v1/index_service.proto | 335 - .../google/cloud/aiplatform/v1/io.proto | 108 - .../cloud/aiplatform/v1/job_service.proto | 1008 -- .../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 | 592 -- .../v1/model_deployment_monitoring_job.proto | 310 - .../aiplatform/v1/model_evaluation.proto | 116 - .../v1/model_evaluation_slice.proto | 71 - .../aiplatform/v1/model_monitoring.proto | 212 - .../cloud/aiplatform/v1/model_service.proto | 662 -- .../cloud/aiplatform/v1/operation.proto | 52 - .../v1/pipeline_failure_policy.proto | 44 - .../cloud/aiplatform/v1/pipeline_job.proto | 365 - .../aiplatform/v1/pipeline_service.proto | 408 - .../cloud/aiplatform/v1/pipeline_state.proto | 58 - .../aiplatform/v1/prediction_service.proto | 231 - .../cloud/aiplatform/v1/saved_query.proto | 85 - .../instance/image_classification.proto | 43 - .../instance/image_object_detection.proto | 43 - .../predict/instance/image_segmentation.proto | 38 - .../instance/text_classification.proto | 37 - .../predict/instance/text_extraction.proto | 44 - .../predict/instance/text_sentiment.proto | 37 - .../instance/video_action_recognition.proto | 50 - .../instance/video_classification.proto | 50 - .../instance/video_object_tracking.proto | 50 - .../predict/params/image_classification.proto | 38 - .../params/image_object_detection.proto | 38 - .../predict/params/image_segmentation.proto | 35 - .../params/video_action_recognition.proto | 38 - .../predict/params/video_classification.proto | 63 - .../params/video_object_tracking.proto | 42 - .../predict/prediction/classification.proto | 40 - .../prediction/image_object_detection.proto | 50 - .../prediction/image_segmentation.proto | 44 - .../prediction/tabular_classification.proto | 38 - .../prediction/tabular_regression.proto | 38 - .../predict/prediction/text_extraction.proto | 51 - .../predict/prediction/text_sentiment.proto | 36 - .../prediction/video_action_recognition.proto | 53 - .../prediction/video_classification.proto | 66 - .../prediction/video_object_tracking.proto | 81 - .../automl_image_classification.proto | 127 - .../automl_image_object_detection.proto | 119 - .../automl_image_segmentation.proto | 105 - .../definition/automl_tables.proto | 283 - .../automl_text_classification.proto | 36 - .../definition/automl_text_extraction.proto | 36 - .../definition/automl_text_sentiment.proto | 43 - .../automl_video_action_recognition.proto | 61 - .../automl_video_classification.proto | 55 - .../automl_video_object_tracking.proto | 66 - .../export_evaluated_data_items_config.proto | 42 - .../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 | 413 - .../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 | 68 - .../v1/dataset_service.delete_dataset.js | 64 - .../v1/dataset_service.export_data.js | 69 - .../v1/dataset_service.get_annotation_spec.js | 67 - .../v1/dataset_service.get_dataset.js | 65 - .../v1/dataset_service.import_data.js | 70 - .../v1/dataset_service.list_annotations.js | 86 - .../v1/dataset_service.list_data_items.js | 86 - .../v1/dataset_service.list_datasets.js | 99 - .../v1/dataset_service.list_saved_queries.js | 86 - .../v1/dataset_service.update_dataset.js | 71 - .../v1/endpoint_service.create_endpoint.js | 79 - .../v1/endpoint_service.delete_endpoint.js | 64 - .../v1/endpoint_service.deploy_model.js | 84 - .../v1/endpoint_service.get_endpoint.js | 63 - .../v1/endpoint_service.list_endpoints.js | 105 - .../v1/endpoint_service.undeploy_model.js | 79 - .../v1/endpoint_service.update_endpoint.js | 66 - ...ine_serving_service.read_feature_values.js | 77 - ...g_service.streaming_read_feature_values.js | 81 - ...turestore_service.batch_create_features.js | 72 - ...store_service.batch_read_feature_values.js | 111 - ...featurestore_service.create_entity_type.js | 77 - .../v1/featurestore_service.create_feature.js | 78 - ...eaturestore_service.create_featurestore.js | 78 - ...featurestore_service.delete_entity_type.js | 69 - .../v1/featurestore_service.delete_feature.js | 64 - ...eaturestore_service.delete_featurestore.js | 70 - ...turestore_service.export_feature_values.js | 88 - .../featurestore_service.get_entity_type.js | 63 - .../v1/featurestore_service.get_feature.js | 63 - .../featurestore_service.get_featurestore.js | 61 - ...turestore_service.import_feature_values.js | 114 - .../featurestore_service.list_entity_types.js | 112 - .../v1/featurestore_service.list_features.js | 122 - ...featurestore_service.list_featurestores.js | 113 - .../featurestore_service.search_features.js | 132 - ...featurestore_service.update_entity_type.js | 84 - .../v1/featurestore_service.update_feature.js | 78 - ...eaturestore_service.update_featurestore.js | 79 - ..._endpoint_service.create_index_endpoint.js | 68 - ..._endpoint_service.delete_index_endpoint.js | 64 - .../v1/index_endpoint_service.deploy_index.js | 69 - ...dex_endpoint_service.get_index_endpoint.js | 63 - ...x_endpoint_service.list_index_endpoints.js | 98 - ..._endpoint_service.mutate_deployed_index.js | 71 - .../index_endpoint_service.undeploy_index.js | 69 - ..._endpoint_service.update_index_endpoint.js | 66 - .../v1/index_service.create_index.js | 68 - .../v1/index_service.delete_index.js | 64 - .../generated/v1/index_service.get_index.js | 63 - .../v1/index_service.list_indexes.js | 83 - .../v1/index_service.remove_datapoints.js | 67 - .../v1/index_service.update_index.js | 67 - .../v1/index_service.upsert_datapoints.js | 67 - ...job_service.cancel_batch_prediction_job.js | 63 - .../v1/job_service.cancel_custom_job.js | 63 - .../job_service.cancel_data_labeling_job.js | 63 - ...ervice.cancel_hyperparameter_tuning_job.js | 63 - ...job_service.create_batch_prediction_job.js | 67 - .../v1/job_service.create_custom_job.js | 67 - .../job_service.create_data_labeling_job.js | 67 - ...ervice.create_hyperparameter_tuning_job.js | 67 - ....create_model_deployment_monitoring_job.js | 67 - ...job_service.delete_batch_prediction_job.js | 64 - .../v1/job_service.delete_custom_job.js | 64 - .../job_service.delete_data_labeling_job.js | 64 - ...ervice.delete_hyperparameter_tuning_job.js | 64 - ....delete_model_deployment_monitoring_job.js | 64 - .../job_service.get_batch_prediction_job.js | 63 - .../v1/job_service.get_custom_job.js | 63 - .../v1/job_service.get_data_labeling_job.js | 63 - ...b_service.get_hyperparameter_tuning_job.js | 63 - ...ice.get_model_deployment_monitoring_job.js | 63 - .../job_service.list_batch_prediction_jobs.js | 94 - .../v1/job_service.list_custom_jobs.js | 93 - .../v1/job_service.list_data_labeling_jobs.js | 99 - ...service.list_hyperparameter_tuning_jobs.js | 93 - ...e.list_model_deployment_monitoring_jobs.js | 90 - ...e.pause_model_deployment_monitoring_job.js | 63 - ....resume_model_deployment_monitoring_job.js | 63 - ...l_deployment_monitoring_stats_anomalies.js | 103 - ....update_model_deployment_monitoring_job.js | 92 - ...ce.add_context_artifacts_and_executions.js | 77 - .../metadata_service.add_context_children.js | 67 - .../metadata_service.add_execution_events.js | 68 - .../v1/metadata_service.create_artifact.js | 79 - .../v1/metadata_service.create_context.js | 79 - .../v1/metadata_service.create_execution.js | 80 - ...metadata_service.create_metadata_schema.js | 80 - .../metadata_service.create_metadata_store.js | 80 - .../v1/metadata_service.delete_artifact.js | 70 - .../v1/metadata_service.delete_context.js | 75 - .../v1/metadata_service.delete_execution.js | 70 - .../metadata_service.delete_metadata_store.js | 64 - .../v1/metadata_service.get_artifact.js | 63 - .../v1/metadata_service.get_context.js | 63 - .../v1/metadata_service.get_execution.js | 63 - .../metadata_service.get_metadata_schema.js | 63 - .../v1/metadata_service.get_metadata_store.js | 63 - .../v1/metadata_service.list_artifacts.js | 105 - .../v1/metadata_service.list_contexts.js | 108 - .../v1/metadata_service.list_executions.js | 105 - .../metadata_service.list_metadata_schemas.js | 84 - .../metadata_service.list_metadata_stores.js | 80 - .../v1/metadata_service.purge_artifacts.js | 76 - .../v1/metadata_service.purge_contexts.js | 76 - .../v1/metadata_service.purge_executions.js | 76 - ...service.query_artifact_lineage_subgraph.js | 96 - ..._service.query_context_lineage_subgraph.js | 67 - ...vice.query_execution_inputs_and_outputs.js | 64 - .../v1/metadata_service.update_artifact.js | 75 - .../v1/metadata_service.update_context.js | 75 - .../v1/metadata_service.update_execution.js | 75 - ...gration_service.batch_migrate_resources.js | 70 - ...ion_service.search_migratable_resources.js | 90 - ...ce.batch_import_model_evaluation_slices.js | 68 - .../v1/model_service.delete_model.js | 63 - .../v1/model_service.delete_model_version.js | 64 - .../v1/model_service.export_model.js | 69 - .../generated/v1/model_service.get_model.js | 71 - .../v1/model_service.get_model_evaluation.js | 63 - ...odel_service.get_model_evaluation_slice.js | 63 - .../model_service.import_model_evaluation.js | 67 - ...el_service.list_model_evaluation_slices.js | 85 - .../model_service.list_model_evaluations.js | 83 - .../v1/model_service.list_model_versions.js | 89 - .../generated/v1/model_service.list_models.js | 105 - .../v1/model_service.merge_version_aliases.js | 78 - .../v1/model_service.update_model.js | 84 - .../v1/model_service.upload_model.js | 80 - .../pipeline_service.cancel_pipeline_job.js | 63 - ...peline_service.cancel_training_pipeline.js | 63 - .../pipeline_service.create_pipeline_job.js | 75 - ...peline_service.create_training_pipeline.js | 67 - .../pipeline_service.delete_pipeline_job.js | 64 - ...peline_service.delete_training_pipeline.js | 64 - .../v1/pipeline_service.get_pipeline_job.js | 63 - .../pipeline_service.get_training_pipeline.js | 63 - .../v1/pipeline_service.list_pipeline_jobs.js | 126 - ...ipeline_service.list_training_pipelines.js | 95 - .../v1/prediction_service.explain.js | 99 - .../v1/prediction_service.predict.js | 83 - .../v1/prediction_service.raw_predict.js | 77 - ...t_metadata.google.cloud.aiplatform.v1.json | 8899 ---------------- ...ist_pool_service.create_specialist_pool.js | 68 - ...ist_pool_service.delete_specialist_pool.js | 69 - ...ialist_pool_service.get_specialist_pool.js | 63 - ...list_pool_service.list_specialist_pools.js | 79 - ...ist_pool_service.update_specialist_pool.js | 67 - ...d_service.batch_create_tensorboard_runs.js | 71 - ...ce.batch_create_tensorboard_time_series.js | 73 - ...batch_read_tensorboard_time_series_data.js | 71 - .../tensorboard_service.create_tensorboard.js | 68 - ...d_service.create_tensorboard_experiment.js | 75 - ...sorboard_service.create_tensorboard_run.js | 76 - ..._service.create_tensorboard_time_series.js | 76 - .../tensorboard_service.delete_tensorboard.js | 64 - ...d_service.delete_tensorboard_experiment.js | 64 - ...sorboard_service.delete_tensorboard_run.js | 64 - ..._service.delete_tensorboard_time_series.js | 64 - ...ice.export_tensorboard_time_series_data.js | 90 - .../v1/tensorboard_service.get_tensorboard.js | 63 - ...oard_service.get_tensorboard_experiment.js | 63 - ...tensorboard_service.get_tensorboard_run.js | 63 - ...ard_service.get_tensorboard_time_series.js | 63 - ...rd_service.list_tensorboard_experiments.js | 93 - ...nsorboard_service.list_tensorboard_runs.js | 93 - ...rd_service.list_tensorboard_time_series.js | 93 - .../tensorboard_service.list_tensorboards.js | 93 - ...oard_service.read_tensorboard_blob_data.js | 69 - ...rvice.read_tensorboard_time_series_data.js | 73 - .../tensorboard_service.update_tensorboard.js | 74 - ...d_service.update_tensorboard_experiment.js | 73 - ...sorboard_service.update_tensorboard_run.js | 73 - ..._service.update_tensorboard_time_series.js | 74 - ...rvice.write_tensorboard_experiment_data.js | 68 - ...oard_service.write_tensorboard_run_data.js | 72 - .../vizier_service.add_trial_measurement.js | 68 - ...ervice.check_trial_early_stopping_state.js | 64 - .../v1/vizier_service.complete_trial.js | 79 - .../v1/vizier_service.create_study.js | 67 - .../v1/vizier_service.create_trial.js | 67 - .../v1/vizier_service.delete_study.js | 62 - .../v1/vizier_service.delete_trial.js | 63 - .../generated/v1/vizier_service.get_study.js | 62 - .../generated/v1/vizier_service.get_trial.js | 63 - .../v1/vizier_service.list_optimal_trials.js | 61 - .../v1/vizier_service.list_studies.js | 74 - .../v1/vizier_service.list_trials.js | 74 - .../v1/vizier_service.lookup_study.js | 67 - .../generated/v1/vizier_service.stop_trial.js | 63 - .../v1/vizier_service.suggest_trials.js | 76 - owl-bot-staging/v1/src/index.ts | 53 - .../v1/src/v1/dataset_service_client.ts | 4297 -------- .../src/v1/dataset_service_client_config.json | 70 - .../v1/src/v1/dataset_service_proto_list.json | 112 - .../v1/src/v1/endpoint_service_client.ts | 3656 ------- .../v1/endpoint_service_client_config.json | 54 - .../src/v1/endpoint_service_proto_list.json | 112 - ...turestore_online_serving_service_client.ts | 2898 ------ ..._online_serving_service_client_config.json | 34 - ...ore_online_serving_service_proto_list.json | 112 - .../v1/src/v1/featurestore_service_client.ts | 5806 ----------- .../featurestore_service_client_config.json | 106 - .../v1/featurestore_service_proto_list.json | 112 - owl-bot-staging/v1/src/v1/gapic_metadata.json | 2277 ---- owl-bot-staging/v1/src/v1/index.ts | 33 - .../src/v1/index_endpoint_service_client.ts | 3713 ------- .../index_endpoint_service_client_config.json | 58 - .../v1/index_endpoint_service_proto_list.json | 112 - .../v1/src/v1/index_service_client.ts | 3529 ------- .../src/v1/index_service_client_config.json | 54 - .../v1/src/v1/index_service_proto_list.json | 112 - .../v1/src/v1/job_service_client.ts | 6087 ----------- .../v1/src/v1/job_service_client_config.json | 138 - .../v1/src/v1/job_service_proto_list.json | 112 - .../v1/src/v1/metadata_service_client.ts | 6412 ------------ .../v1/metadata_service_client_config.json | 150 - .../src/v1/metadata_service_proto_list.json | 112 - .../v1/src/v1/migration_service_client.ts | 3137 ------ .../v1/migration_service_client_config.json | 34 - .../src/v1/migration_service_proto_list.json | 112 - .../v1/src/v1/model_service_client.ts | 4688 --------- .../src/v1/model_service_client_config.json | 86 - .../v1/src/v1/model_service_proto_list.json | 112 - .../v1/src/v1/pipeline_service_client.ts | 4057 -------- .../v1/pipeline_service_client_config.json | 66 - .../src/v1/pipeline_service_proto_list.json | 112 - .../v1/src/v1/prediction_service_client.ts | 3045 ------ .../v1/prediction_service_client_config.json | 38 - .../src/v1/prediction_service_proto_list.json | 112 - .../src/v1/specialist_pool_service_client.ts | 3378 ------ ...specialist_pool_service_client_config.json | 46 - .../specialist_pool_service_proto_list.json | 112 - .../v1/src/v1/tensorboard_service_client.ts | 5882 ----------- .../v1/tensorboard_service_client_config.json | 138 - .../v1/tensorboard_service_proto_list.json | 112 - .../v1/src/v1/vizier_service_client.ts | 4208 -------- .../src/v1/vizier_service_client_config.json | 86 - .../v1/src/v1/vizier_service_proto_list.json | 112 - .../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 | 4569 -------- .../v1/test/gapic_endpoint_service_v1.ts | 3726 ------- ..._featurestore_online_serving_service_v1.ts | 2783 ----- .../v1/test/gapic_featurestore_service_v1.ts | 5901 ----------- .../test/gapic_index_endpoint_service_v1.ts | 3880 ------- .../v1/test/gapic_index_service_v1.ts | 3680 ------- .../v1/test/gapic_job_service_v1.ts | 6771 ------------ .../v1/test/gapic_metadata_service_v1.ts | 7088 ------------- .../v1/test/gapic_migration_service_v1.ts | 3044 ------ .../v1/test/gapic_model_service_v1.ts | 5001 --------- .../v1/test/gapic_pipeline_service_v1.ts | 4091 -------- .../v1/test/gapic_prediction_service_v1.ts | 2888 ------ .../test/gapic_specialist_pool_service_v1.ts | 3464 ------- .../v1/test/gapic_tensorboard_service_v1.ts | 6677 ------------ .../v1/test/gapic_vizier_service_v1.ts | 4631 --------- 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 | 79 - .../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 | 314 - .../aiplatform/v1beta1/completion_stats.proto | 48 - .../cloud/aiplatform/v1beta1/context.proto | 94 - .../cloud/aiplatform/v1beta1/custom_job.proto | 280 - .../cloud/aiplatform/v1beta1/data_item.proto | 70 - .../v1beta1/data_labeling_job.proto | 207 - .../cloud/aiplatform/v1beta1/dataset.proto | 144 - .../aiplatform/v1beta1/dataset_service.proto | 461 - .../v1beta1/deployed_index_ref.proto | 42 - .../v1beta1/deployed_model_ref.proto | 42 - .../v1beta1/deployment_resource_pool.proto | 50 - .../deployment_resource_pool_service.proto | 219 - .../aiplatform/v1beta1/encryption_spec.proto | 38 - .../cloud/aiplatform/v1beta1/endpoint.proto | 262 - .../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 | 273 - .../v1beta1/featurestore_service.proto | 1226 --- .../v1beta1/hyperparameter_tuning_job.proto | 110 - .../cloud/aiplatform/v1beta1/index.proto | 172 - .../aiplatform/v1beta1/index_endpoint.proto | 245 - .../v1beta1/index_endpoint_service.proto | 335 - .../aiplatform/v1beta1/index_service.proto | 335 - .../google/cloud/aiplatform/v1beta1/io.proto | 108 - .../aiplatform/v1beta1/job_service.proto | 1008 -- .../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 | 592 -- .../model_deployment_monitoring_job.proto | 310 - .../aiplatform/v1beta1/model_evaluation.proto | 94 - .../v1beta1/model_evaluation_slice.proto | 71 - .../aiplatform/v1beta1/model_monitoring.proto | 239 - .../aiplatform/v1beta1/model_service.proto | 693 -- .../cloud/aiplatform/v1beta1/operation.proto | 52 - .../v1beta1/pipeline_failure_policy.proto | 44 - .../aiplatform/v1beta1/pipeline_job.proto | 349 - .../aiplatform/v1beta1/pipeline_service.proto | 405 - .../aiplatform/v1beta1/pipeline_state.proto | 58 - .../v1beta1/prediction_service.proto | 231 - .../aiplatform/v1beta1/saved_query.proto | 85 - .../v1beta1/schema/annotation_payload.proto | 230 - .../schema/annotation_spec_color.proto | 42 - .../v1beta1/schema/data_item_payload.proto | 67 - .../v1beta1/schema/dataset_metadata.proto | 126 - .../aiplatform/v1beta1/schema/geometry.proto | 37 - .../instance/image_classification.proto | 43 - .../instance/image_object_detection.proto | 43 - .../predict/instance/image_segmentation.proto | 38 - .../instance/text_classification.proto | 37 - .../predict/instance/text_extraction.proto | 44 - .../predict/instance/text_sentiment.proto | 37 - .../instance/video_action_recognition.proto | 50 - .../instance/video_classification.proto | 50 - .../instance/video_object_tracking.proto | 50 - .../predict/params/image_classification.proto | 38 - .../params/image_object_detection.proto | 38 - .../predict/params/image_segmentation.proto | 35 - .../params/video_action_recognition.proto | 38 - .../predict/params/video_classification.proto | 63 - .../params/video_object_tracking.proto | 42 - .../predict/prediction/classification.proto | 40 - .../prediction/image_object_detection.proto | 50 - .../prediction/image_segmentation.proto | 44 - .../prediction/tabular_classification.proto | 38 - .../prediction/tabular_regression.proto | 38 - .../predict/prediction/text_extraction.proto | 51 - .../predict/prediction/text_sentiment.proto | 36 - .../prediction/time_series_forecasting.proto | 32 - .../prediction/video_action_recognition.proto | 53 - .../prediction/video_classification.proto | 66 - .../prediction/video_object_tracking.proto | 81 - .../automl_image_classification.proto | 127 - .../automl_image_object_detection.proto | 119 - .../automl_image_segmentation.proto | 105 - .../definition/automl_tables.proto | 283 - .../automl_text_classification.proto | 36 - .../definition/automl_text_extraction.proto | 36 - .../definition/automl_text_sentiment.proto | 43 - .../automl_time_series_forecasting.proto | 286 - .../automl_video_action_recognition.proto | 61 - .../automl_video_classification.proto | 55 - .../automl_video_object_tracking.proto | 66 - .../export_evaluated_data_items_config.proto | 42 - .../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 | 413 - .../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 | 68 - .../v1beta1/dataset_service.delete_dataset.js | 64 - .../v1beta1/dataset_service.export_data.js | 69 - .../dataset_service.get_annotation_spec.js | 67 - .../v1beta1/dataset_service.get_dataset.js | 65 - .../v1beta1/dataset_service.import_data.js | 70 - .../dataset_service.list_annotations.js | 86 - .../dataset_service.list_data_items.js | 86 - .../v1beta1/dataset_service.list_datasets.js | 99 - .../dataset_service.list_saved_queries.js | 86 - .../v1beta1/dataset_service.update_dataset.js | 71 - ...service.create_deployment_resource_pool.js | 77 - ...service.delete_deployment_resource_pool.js | 64 - ...ol_service.get_deployment_resource_pool.js | 63 - ..._service.list_deployment_resource_pools.js | 77 - ...urce_pool_service.query_deployed_models.js | 78 - .../endpoint_service.create_endpoint.js | 79 - .../endpoint_service.delete_endpoint.js | 64 - .../v1beta1/endpoint_service.deploy_model.js | 84 - .../v1beta1/endpoint_service.get_endpoint.js | 63 - .../endpoint_service.list_endpoints.js | 95 - .../endpoint_service.undeploy_model.js | 79 - .../endpoint_service.update_endpoint.js | 66 - ...ine_serving_service.read_feature_values.js | 77 - ...g_service.streaming_read_feature_values.js | 81 - ...ne_serving_service.write_feature_values.js | 71 - ...turestore_service.batch_create_features.js | 72 - ...store_service.batch_read_feature_values.js | 111 - ...featurestore_service.create_entity_type.js | 77 - .../featurestore_service.create_feature.js | 78 - ...eaturestore_service.create_featurestore.js | 78 - ...featurestore_service.delete_entity_type.js | 69 - .../featurestore_service.delete_feature.js | 64 - ...eaturestore_service.delete_featurestore.js | 70 - ...turestore_service.export_feature_values.js | 88 - .../featurestore_service.get_entity_type.js | 63 - .../featurestore_service.get_feature.js | 63 - .../featurestore_service.get_featurestore.js | 61 - ...turestore_service.import_feature_values.js | 114 - .../featurestore_service.list_entity_types.js | 112 - .../featurestore_service.list_features.js | 122 - ...featurestore_service.list_featurestores.js | 113 - .../featurestore_service.search_features.js | 132 - ...featurestore_service.update_entity_type.js | 84 - .../featurestore_service.update_feature.js | 78 - ...eaturestore_service.update_featurestore.js | 79 - ..._endpoint_service.create_index_endpoint.js | 68 - ..._endpoint_service.delete_index_endpoint.js | 64 - .../index_endpoint_service.deploy_index.js | 69 - ...dex_endpoint_service.get_index_endpoint.js | 63 - ...x_endpoint_service.list_index_endpoints.js | 98 - ..._endpoint_service.mutate_deployed_index.js | 71 - .../index_endpoint_service.undeploy_index.js | 69 - ..._endpoint_service.update_index_endpoint.js | 66 - .../v1beta1/index_service.create_index.js | 68 - .../v1beta1/index_service.delete_index.js | 64 - .../v1beta1/index_service.get_index.js | 63 - .../v1beta1/index_service.list_indexes.js | 83 - .../index_service.remove_datapoints.js | 67 - .../v1beta1/index_service.update_index.js | 67 - .../index_service.upsert_datapoints.js | 67 - ...job_service.cancel_batch_prediction_job.js | 63 - .../v1beta1/job_service.cancel_custom_job.js | 63 - .../job_service.cancel_data_labeling_job.js | 63 - ...ervice.cancel_hyperparameter_tuning_job.js | 63 - ...job_service.create_batch_prediction_job.js | 67 - .../v1beta1/job_service.create_custom_job.js | 67 - .../job_service.create_data_labeling_job.js | 67 - ...ervice.create_hyperparameter_tuning_job.js | 67 - ....create_model_deployment_monitoring_job.js | 67 - ...job_service.delete_batch_prediction_job.js | 64 - .../v1beta1/job_service.delete_custom_job.js | 64 - .../job_service.delete_data_labeling_job.js | 64 - ...ervice.delete_hyperparameter_tuning_job.js | 64 - ....delete_model_deployment_monitoring_job.js | 64 - .../job_service.get_batch_prediction_job.js | 63 - .../v1beta1/job_service.get_custom_job.js | 63 - .../job_service.get_data_labeling_job.js | 63 - ...b_service.get_hyperparameter_tuning_job.js | 63 - ...ice.get_model_deployment_monitoring_job.js | 63 - .../job_service.list_batch_prediction_jobs.js | 94 - .../v1beta1/job_service.list_custom_jobs.js | 93 - .../job_service.list_data_labeling_jobs.js | 99 - ...service.list_hyperparameter_tuning_jobs.js | 93 - ...e.list_model_deployment_monitoring_jobs.js | 90 - ...e.pause_model_deployment_monitoring_job.js | 63 - ....resume_model_deployment_monitoring_job.js | 63 - ...l_deployment_monitoring_stats_anomalies.js | 103 - ....update_model_deployment_monitoring_job.js | 92 - ...ce.add_context_artifacts_and_executions.js | 77 - .../metadata_service.add_context_children.js | 67 - .../metadata_service.add_execution_events.js | 68 - .../metadata_service.create_artifact.js | 79 - .../metadata_service.create_context.js | 79 - .../metadata_service.create_execution.js | 80 - ...metadata_service.create_metadata_schema.js | 80 - .../metadata_service.create_metadata_store.js | 80 - .../metadata_service.delete_artifact.js | 70 - .../metadata_service.delete_context.js | 75 - .../metadata_service.delete_execution.js | 70 - .../metadata_service.delete_metadata_store.js | 64 - .../v1beta1/metadata_service.get_artifact.js | 63 - .../v1beta1/metadata_service.get_context.js | 63 - .../v1beta1/metadata_service.get_execution.js | 63 - .../metadata_service.get_metadata_schema.js | 63 - .../metadata_service.get_metadata_store.js | 63 - .../metadata_service.list_artifacts.js | 105 - .../v1beta1/metadata_service.list_contexts.js | 108 - .../metadata_service.list_executions.js | 105 - .../metadata_service.list_metadata_schemas.js | 84 - .../metadata_service.list_metadata_stores.js | 80 - .../metadata_service.purge_artifacts.js | 76 - .../metadata_service.purge_contexts.js | 76 - .../metadata_service.purge_executions.js | 76 - ...service.query_artifact_lineage_subgraph.js | 96 - ..._service.query_context_lineage_subgraph.js | 67 - ...vice.query_execution_inputs_and_outputs.js | 64 - .../metadata_service.update_artifact.js | 75 - .../metadata_service.update_context.js | 75 - .../metadata_service.update_execution.js | 75 - ...gration_service.batch_migrate_resources.js | 70 - ...ion_service.search_migratable_resources.js | 90 - ...ce.batch_import_model_evaluation_slices.js | 68 - .../v1beta1/model_service.delete_model.js | 63 - .../model_service.delete_model_version.js | 64 - .../v1beta1/model_service.export_model.js | 69 - .../v1beta1/model_service.get_model.js | 71 - .../model_service.get_model_evaluation.js | 63 - ...odel_service.get_model_evaluation_slice.js | 63 - .../model_service.import_model_evaluation.js | 67 - ...el_service.list_model_evaluation_slices.js | 85 - .../model_service.list_model_evaluations.js | 83 - .../model_service.list_model_versions.js | 89 - .../v1beta1/model_service.list_models.js | 95 - .../model_service.merge_version_aliases.js | 78 - ...odel_service.update_explanation_dataset.js | 67 - .../v1beta1/model_service.update_model.js | 84 - .../v1beta1/model_service.upload_model.js | 80 - .../pipeline_service.cancel_pipeline_job.js | 63 - ...peline_service.cancel_training_pipeline.js | 63 - .../pipeline_service.create_pipeline_job.js | 75 - ...peline_service.create_training_pipeline.js | 67 - .../pipeline_service.delete_pipeline_job.js | 64 - ...peline_service.delete_training_pipeline.js | 64 - .../pipeline_service.get_pipeline_job.js | 63 - .../pipeline_service.get_training_pipeline.js | 63 - .../pipeline_service.list_pipeline_jobs.js | 122 - ...ipeline_service.list_training_pipelines.js | 95 - .../v1beta1/prediction_service.explain.js | 99 - .../v1beta1/prediction_service.predict.js | 83 - .../v1beta1/prediction_service.raw_predict.js | 77 - ...adata.google.cloud.aiplatform.v1beta1.json | 9199 ----------------- ...ist_pool_service.create_specialist_pool.js | 68 - ...ist_pool_service.delete_specialist_pool.js | 69 - ...ialist_pool_service.get_specialist_pool.js | 63 - ...list_pool_service.list_specialist_pools.js | 79 - ...ist_pool_service.update_specialist_pool.js | 67 - ...d_service.batch_create_tensorboard_runs.js | 71 - ...ce.batch_create_tensorboard_time_series.js | 73 - ...batch_read_tensorboard_time_series_data.js | 71 - .../tensorboard_service.create_tensorboard.js | 68 - ...d_service.create_tensorboard_experiment.js | 75 - ...sorboard_service.create_tensorboard_run.js | 76 - ..._service.create_tensorboard_time_series.js | 76 - .../tensorboard_service.delete_tensorboard.js | 64 - ...d_service.delete_tensorboard_experiment.js | 64 - ...sorboard_service.delete_tensorboard_run.js | 64 - ..._service.delete_tensorboard_time_series.js | 64 - ...ice.export_tensorboard_time_series_data.js | 90 - .../tensorboard_service.get_tensorboard.js | 63 - ...oard_service.get_tensorboard_experiment.js | 63 - ...tensorboard_service.get_tensorboard_run.js | 63 - ...ard_service.get_tensorboard_time_series.js | 63 - ...rd_service.list_tensorboard_experiments.js | 93 - ...nsorboard_service.list_tensorboard_runs.js | 93 - ...rd_service.list_tensorboard_time_series.js | 93 - .../tensorboard_service.list_tensorboards.js | 93 - ...oard_service.read_tensorboard_blob_data.js | 69 - ...rvice.read_tensorboard_time_series_data.js | 73 - .../tensorboard_service.update_tensorboard.js | 74 - ...d_service.update_tensorboard_experiment.js | 73 - ...sorboard_service.update_tensorboard_run.js | 73 - ..._service.update_tensorboard_time_series.js | 74 - ...rvice.write_tensorboard_experiment_data.js | 68 - ...oard_service.write_tensorboard_run_data.js | 72 - .../vizier_service.add_trial_measurement.js | 68 - ...ervice.check_trial_early_stopping_state.js | 64 - .../v1beta1/vizier_service.complete_trial.js | 79 - .../v1beta1/vizier_service.create_study.js | 67 - .../v1beta1/vizier_service.create_trial.js | 67 - .../v1beta1/vizier_service.delete_study.js | 62 - .../v1beta1/vizier_service.delete_trial.js | 63 - .../v1beta1/vizier_service.get_study.js | 62 - .../v1beta1/vizier_service.get_trial.js | 63 - .../vizier_service.list_optimal_trials.js | 61 - .../v1beta1/vizier_service.list_studies.js | 74 - .../v1beta1/vizier_service.list_trials.js | 74 - .../v1beta1/vizier_service.lookup_study.js | 67 - .../v1beta1/vizier_service.stop_trial.js | 63 - .../v1beta1/vizier_service.suggest_trials.js | 76 - owl-bot-staging/v1beta1/src/index.ts | 55 - .../src/v1beta1/dataset_service_client.ts | 4349 -------- .../dataset_service_client_config.json | 80 - .../v1beta1/dataset_service_proto_list.json | 121 - ...deployment_resource_pool_service_client.ts | 3556 ------- ...t_resource_pool_service_client_config.json | 46 - ...ment_resource_pool_service_proto_list.json | 121 - .../src/v1beta1/endpoint_service_client.ts | 3681 ------- .../endpoint_service_client_config.json | 61 - .../v1beta1/endpoint_service_proto_list.json | 121 - ...turestore_online_serving_service_client.ts | 3032 ------ ..._online_serving_service_client_config.json | 40 - ...ore_online_serving_service_proto_list.json | 121 - .../v1beta1/featurestore_service_client.ts | 5858 ----------- .../featurestore_service_client_config.json | 125 - .../featurestore_service_proto_list.json | 121 - .../v1beta1/src/v1beta1/gapic_metadata.json | 2369 ----- owl-bot-staging/v1beta1/src/v1beta1/index.ts | 34 - .../v1beta1/index_endpoint_service_client.ts | 3765 ------- .../index_endpoint_service_client_config.json | 65 - .../index_endpoint_service_proto_list.json | 121 - .../src/v1beta1/index_service_client.ts | 3581 ------- .../v1beta1/index_service_client_config.json | 59 - .../src/v1beta1/index_service_proto_list.json | 121 - .../v1beta1/src/v1beta1/job_service_client.ts | 6139 ----------- .../v1beta1/job_service_client_config.json | 166 - .../src/v1beta1/job_service_proto_list.json | 121 - .../src/v1beta1/metadata_service_client.ts | 6464 ------------ .../metadata_service_client_config.json | 175 - .../v1beta1/metadata_service_proto_list.json | 121 - .../src/v1beta1/migration_service_client.ts | 3189 ------ .../migration_service_client_config.json | 34 - .../v1beta1/migration_service_proto_list.json | 121 - .../src/v1beta1/model_service_client.ts | 4812 --------- .../v1beta1/model_service_client_config.json | 100 - .../src/v1beta1/model_service_proto_list.json | 121 - .../src/v1beta1/pipeline_service_client.ts | 4103 -------- .../pipeline_service_client_config.json | 71 - .../v1beta1/pipeline_service_proto_list.json | 121 - .../src/v1beta1/prediction_service_client.ts | 3097 ------ .../prediction_service_client_config.json | 40 - .../prediction_service_proto_list.json | 121 - .../v1beta1/specialist_pool_service_client.ts | 3430 ------ ...specialist_pool_service_client_config.json | 51 - .../specialist_pool_service_proto_list.json | 121 - .../src/v1beta1/tensorboard_service_client.ts | 5933 ----------- .../tensorboard_service_client_config.json | 138 - .../tensorboard_service_proto_list.json | 121 - .../src/v1beta1/vizier_service_client.ts | 4260 -------- .../v1beta1/vizier_service_client_config.json | 101 - .../v1beta1/vizier_service_proto_list.json | 121 - .../system-test/fixtures/sample/src/index.js | 42 - .../system-test/fixtures/sample/src/index.ts | 122 - .../v1beta1/system-test/install.ts | 49 - .../test/gapic_dataset_service_v1beta1.ts | 4615 --------- ...eployment_resource_pool_service_v1beta1.ts | 3627 ------- .../test/gapic_endpoint_service_v1beta1.ts | 3772 ------- ...urestore_online_serving_service_v1beta1.ts | 2937 ------ .../gapic_featurestore_service_v1beta1.ts | 5947 ----------- .../gapic_index_endpoint_service_v1beta1.ts | 3926 ------- .../test/gapic_index_service_v1beta1.ts | 3726 ------- .../v1beta1/test/gapic_job_service_v1beta1.ts | 6817 ------------ .../test/gapic_metadata_service_v1beta1.ts | 7134 ------------- .../test/gapic_migration_service_v1beta1.ts | 3090 ------ .../test/gapic_model_service_v1beta1.ts | 5201 ---------- .../test/gapic_pipeline_service_v1beta1.ts | 4137 -------- .../test/gapic_prediction_service_v1beta1.ts | 2934 ------ .../gapic_specialist_pool_service_v1beta1.ts | 3510 ------- .../test/gapic_tensorboard_service_v1beta1.ts | 6723 ------------ .../test/gapic_vizier_service_v1beta1.ts | 4677 --------- owl-bot-staging/v1beta1/tsconfig.json | 19 - owl-bot-staging/v1beta1/webpack.config.js | 64 - src/v1/dataset_service_client.ts | 38 +- src/v1/endpoint_service_client.ts | 18 +- ...turestore_online_serving_service_client.ts | 4 +- src/v1/featurestore_service_client.ts | 56 +- src/v1/index_endpoint_service_client.ts | 20 +- src/v1/index_service_client.ts | 18 +- src/v1/job_service_client.ts | 80 +- src/v1/metadata_service_client.ts | 82 +- src/v1/migration_service_client.ts | 8 +- src/v1/model_service_client.ts | 46 +- src/v1/pipeline_service_client.ts | 28 +- src/v1/prediction_service_client.ts | 6 +- src/v1/specialist_pool_service_client.ts | 14 +- src/v1/tensorboard_service_client.ts | 76 +- src/v1/vizier_service_client.ts | 38 +- src/v1beta1/dataset_service_client.ts | 38 +- ...deployment_resource_pool_service_client.ts | 18 +- src/v1beta1/endpoint_service_client.ts | 18 +- ...turestore_online_serving_service_client.ts | 6 +- src/v1beta1/featurestore_service_client.ts | 56 +- src/v1beta1/index_endpoint_service_client.ts | 20 +- src/v1beta1/index_service_client.ts | 18 +- src/v1beta1/job_service_client.ts | 80 +- src/v1beta1/metadata_service_client.ts | 82 +- src/v1beta1/migration_service_client.ts | 8 +- src/v1beta1/model_service_client.ts | 48 +- src/v1beta1/pipeline_service_client.ts | 28 +- src/v1beta1/prediction_service_client.ts | 6 +- src/v1beta1/specialist_pool_service_client.ts | 14 +- src/v1beta1/tensorboard_service_client.ts | 76 +- src/v1beta1/vizier_service_client.ts | 38 +- test/gapic_dataset_service_v1.ts | 1323 +-- test/gapic_dataset_service_v1beta1.ts | 1323 +-- ...eployment_resource_pool_service_v1beta1.ts | 652 +- test/gapic_endpoint_service_v1.ts | 794 +- test/gapic_endpoint_service_v1beta1.ts | 794 +- ..._featurestore_online_serving_service_v1.ts | 181 +- ...urestore_online_serving_service_v1beta1.ts | 267 +- test/gapic_featurestore_service_v1.ts | 2307 +++-- test/gapic_featurestore_service_v1beta1.ts | 2307 +++-- test/gapic_index_endpoint_service_v1.ts | 910 +- test/gapic_index_endpoint_service_v1beta1.ts | 910 +- test/gapic_index_service_v1.ts | 764 +- test/gapic_index_service_v1beta1.ts | 764 +- test/gapic_job_service_v1.ts | 3074 +++--- test/gapic_job_service_v1beta1.ts | 3074 +++--- test/gapic_metadata_service_v1.ts | 3248 +++--- test/gapic_metadata_service_v1beta1.ts | 3248 +++--- test/gapic_migration_service_v1.ts | 297 +- test/gapic_migration_service_v1beta1.ts | 297 +- test/gapic_model_service_v1.ts | 1690 +-- test/gapic_model_service_v1beta1.ts | 1802 ++-- test/gapic_pipeline_service_v1.ts | 1082 +- test/gapic_pipeline_service_v1beta1.ts | 1082 +- test/gapic_prediction_service_v1.ts | 275 +- test/gapic_prediction_service_v1beta1.ts | 275 +- test/gapic_specialist_pool_service_v1.ts | 608 +- test/gapic_specialist_pool_service_v1beta1.ts | 608 +- test/gapic_tensorboard_service_v1.ts | 2977 +++--- test/gapic_tensorboard_service_v1beta1.ts | 2977 +++--- test/gapic_vizier_service_v1.ts | 1479 +-- test/gapic_vizier_service_v1beta1.ts | 1479 +-- 842 files changed, 22801 insertions(+), 394881 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_failure_policy.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/saved_query.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.list_saved_queries.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.remove_datapoints.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/index_service.upsert_datapoints.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.batch_import_model_evaluation_slices.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.delete_model_version.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_model_versions.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.merge_version_aliases.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/deployment_resource_pool.proto delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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.list_saved_queries.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/deployment_resource_pool_service.create_deployment_resource_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.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_online_serving_service.write_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.remove_datapoints.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/index_service.upsert_datapoints.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.batch_import_model_evaluation_slices.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_explanation_dataset.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/deployment_resource_pool_service_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_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_deployment_resource_pool_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 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 36769bb3..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/ && minifyProtoJson", - "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": "^3.5.1" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.59", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} 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 3212d0ce..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/batch_prediction_job.proto +++ /dev/null @@ -1,292 +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. - // - // The model resource name may contain version id or version alias to specify - // the version, if no version is specified, the default version will be used. - 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.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 a1d7b323..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/completion_stats.proto +++ /dev/null @@ -1,48 +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]; - - // Output only. The number of the successful forecast points that are generated by the - // forecasting model. This is ONLY used by the forecasting batch prediction. - int64 successful_forecast_point_count = 5 [(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 38d68c01..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/custom_job.proto +++ /dev/null @@ -1,280 +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: 15 -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; - - // Optional. 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.field_behavior) = OPTIONAL, - (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 c26f60e3..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/dataset_service.proto +++ /dev/null @@ -1,461 +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/cloud/aiplatform/v1/saved_query.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"; - } - - // Lists SavedQueries in a Dataset. - rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/datasets/*}/savedQueries" - }; - 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.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries]. -message ListSavedQueriesRequest { - // Required. The resource name of the Dataset to list SavedQueries 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.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries]. -message ListSavedQueriesResponse { - // A list of SavedQueries that match the specified filter in the request. - repeated SavedQuery saved_queries = 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 6d48f8f2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/endpoint.proto +++ /dev/null @@ -1,258 +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 resource 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. - // - // The resource name may contain version id or version alias to specify the - // version, if no version is specified, the default version will be deployed. - 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.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 0c00d8a2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/explanation.proto +++ /dev/null @@ -1,461 +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]; - - // 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.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]; -} - -// 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]; - - // Optional. Metadata describing the Model's input and output for explanation. - ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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_indices 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 example-based explanations parameter overrides. - ExamplesOverride examples_override = 3; -} - -// 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]; -} - -// 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/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 5ee0c1ce..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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; - - // Name of the source to generate embeddings for example based explanations. - string latent_space_source = 5; -} 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 4c8a72f5..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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 { - // 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/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 915c4c3f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_online_service.proto +++ /dev/null @@ -1,224 +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. -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 9adfec3f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/featurestore_service.proto +++ /dev/null @@ -1,1226 +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` - // * `online_serving_config.scaling` - 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 69fde66a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index.proto +++ /dev/null @@ -1,172 +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}" - }; - - // The update method of an Index. - enum IndexUpdateMethod { - // Should not be used. - INDEX_UPDATE_METHOD_UNSPECIFIED = 0; - - // BatchUpdate: user can call UpdateIndex with files on Cloud Storage of - // datapoints to update. - BATCH_UPDATE = 1; - - // StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update - // the Index and the updates will be applied in corresponding - // DeployedIndexes in nearly real-time. - STREAM_UPDATE = 2; - } - - // 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]; - - // Output only. Stats of the index resource. - IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be - // used by default. - IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A datapoint of Index. -message IndexDatapoint { - // Restriction of a datapoint which describe its attributes(tokens) from each - // of several attribute categories(namespaces). - message Restriction { - // The namespace of this restriction. eg: color. - string namespace = 1; - - // The attributes to allow in this namespace. eg: 'red' - repeated string allow_list = 2; - - // The attributes to deny in this namespace. eg: 'blue' - repeated string deny_list = 3; - } - - // Crowding tag is a constraint on a neighbor list produced by nearest - // neighbor search requiring that no more than some value k' of the k - // neighbors returned have the same value of crowding_attribute. - message CrowdingTag { - // The attribute value used for crowding. The maximum number of neighbors - // to return per crowding attribute value - // (per_crowding_attribute_num_neighbors) is configured per-query. This - // field is ignored if per_crowding_attribute_num_neighbors is larger than - // the total number of neighbors to return for a given query. - string crowding_attribute = 1; - } - - // Required. Unique identifier of the datapoint. - string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Feature embedding vector. An array of numbers with the length of - // [NearestNeighborSearchConfig.dimensions]. - repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. List of Restrict of the datapoint, used to perform "restricted searches" - // where boolean rule are used to filter the subset of the database eligible - // for matching. - // See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering - repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. CrowdingTag of the datapoint, the number of neighbors to return in each - // crowding can be configured during query. - CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Stats of the Index. -message IndexStats { - // Output only. The number of vectors in the Index. - int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of shards in the Index. - int32 shards_count = 2 [(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 0f6c6325..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/index_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.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" - }; - } - - // Add/update Datapoints into an Index. - rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) { - option (google.api.http) = { - post: "/v1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints" - body: "*" - }; - } - - // Remove Datapoints from an Index. - rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) { - option (google.api.http) = { - post: "/v1/{index=projects/*/locations/*/indexes/*}:removeDatapoints" - body: "*" - }; - } -} - -// 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" - } - ]; -} - -// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] -message UpsertDatapointsRequest { - // Required. The name of the Index resource to be updated. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string index = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // A list of datapoints to be created/updated. - repeated IndexDatapoint datapoints = 2; -} - -// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] -message UpsertDatapointsResponse { - -} - -// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] -message RemoveDatapointsRequest { - // Required. The name of the Index resource to be updated. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string index = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // A list of datapoint ids to be deleted. - repeated string datapoint_ids = 2; -} - -// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] -message RemoveDatapointsResponse { - -} - -// 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 82198a26..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/job_service.proto +++ /dev/null @@ -1,1008 +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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `model_display_name` supports `=`, `!=` comparisons. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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. - // - // Supported fields: - // - // * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 e469d45e..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 64. - 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 26c1d3b7..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model.proto +++ /dev/null @@ -1,592 +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; - - // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1.DeployedModel]. - // A pre-configured [DeploymentResourcePool][] is required. - SHARED_RESOURCES = 3; - } - - // 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.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 87252239..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,310 +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]; - - // The time window of the prediction data being included in each prediction - // dataset. This window specifies how long the data should be collected from - // historical model results for each run. If not set, - // [ModelDeploymentMonitoringScheduleConfig.monitor_interval][google.cloud.aiplatform.v1.ModelDeploymentMonitoringScheduleConfig.monitor_interval] will be used. - // e.g. If currently the cutoff time is 2022-01-08 14:30:00 and the - // monitor_window is set to be 3600, then data from 2022-01-08 13:30:00 - // to 2022-01-08 14:30:00 will be retrieved and aggregated to calculate the - // monitoring statistics. - google.protobuf.Duration monitor_window = 2; -} - -// 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 039161dd..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_monitoring.proto +++ /dev/null @@ -1,212 +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"; - -// The objective configuration for model monitoring, including the information -// needed to detect anomalies for one particular model. -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. - // "jsonl" - // The source file is a JSONL 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; - - // Skew anomaly detection threshold used by all features. - // When the per-feature thresholds are not set, this field can be used to - // specify a threshold for all features. - ThresholdConfig default_skew_threshold = 6; - } - - // 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; - - // Drift anomaly detection threshold used by all features. - // When the per-feature thresholds are not set, this field can be used to - // specify a threshold for all features. - ThresholdConfig default_drift_threshold = 5; - } - - // 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; -} - -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. -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. -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 9ea6c56c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/model_service.proto +++ /dev/null @@ -1,662 +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"; - } - - // Lists versions of the specified model. - rpc ListModelVersions(ListModelVersionsRequest) returns (ListModelVersionsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/models/*}:listVersions" - }; - option (google.api.method_signature) = "name"; - } - - // 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" - }; - } - - // 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.v1.ModelService.DeleteModel] for deleting the Model instead. - rpc DeleteModelVersion(DeleteModelVersionRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{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: "/v1/{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.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"; - } - - // Imports a list of externally generated ModelEvaluationSlice. - rpc BatchImportModelEvaluationSlices(BatchImportModelEvaluationSlicesRequest) returns (BatchImportModelEvaluationSlicesResponse) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices:batchImport" - body: "*" - }; - option (google.api.method_signature) = "parent,model_evaluation_slices"; - } - - // 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" - } - ]; - - // 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.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" - }]; - - // 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.v1.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.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.ListModelVersions][google.cloud.aiplatform.v1.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.v1.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.v1.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.v1.ListModelVersionsRequest.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.DeleteModelVersion][google.cloud.aiplatform.v1.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.v1.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-zA-Z0-9-]{0,126}[a-z-0-9]`. - // Add the `-` prefix to an alias means removing that alias from the version. - // `-` is NOT counted in the 128 characters. Example: `-golden` means removing - // the `golden` alias from the version. - // - // There is NO ordering in aliases, which means - // 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.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. - // 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.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.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.BatchImportModelEvaluationSlices] -message BatchImportModelEvaluationSlicesRequest { - // Required. The name of the parent ModelEvaluation resource. - // 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" - } - ]; - - // Required. Model evaluation slice resource to be imported. - repeated ModelEvaluationSlice model_evaluation_slices = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.BatchImportModelEvaluationSlices] -message BatchImportModelEvaluationSlicesResponse { - // Output only. List of imported [ModelEvaluationSlice.name][google.cloud.aiplatform.v1.ModelEvaluationSlice.name]. - repeated string imported_model_evaluation_slices = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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_failure_policy.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto deleted file mode 100644 index 5ff3b78b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_failure_policy.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; - -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 = "PipelineFailurePolicyProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// Represents the failure policy of a pipeline. Currently, the default of a -// pipeline is that the pipeline will continue to run until no more tasks can be -// executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a -// pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling -// any new tasks when a task has failed. Any scheduled tasks will continue to -// completion. -enum PipelineFailurePolicy { - // Default value, and follows fail slow behavior. - PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0; - - // Indicates that the pipeline should continue to run until all possible - // tasks have been scheduled and completed. - PIPELINE_FAILURE_POLICY_FAIL_SLOW = 1; - - // Indicates that the pipeline should stop scheduling new tasks after a task - // has failed. - PIPELINE_FAILURE_POLICY_FAIL_FAST = 2; -} 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 656a385b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_job.proto +++ /dev/null @@ -1,365 +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_failure_policy.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 { - // The type of an input artifact. - message InputArtifact { - oneof kind { - // Artifact resource id from MLMD. Which is the last portion of an - // artifact resource - // name(projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}). - // The artifact must stay within the same project, location and default - // metadatastore as the pipeline. - string artifact_id = 1; - } - } - - // 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; - - // Represents the failure policy of a pipeline. Currently, the default of a - // pipeline is that the pipeline will continue to run until no more tasks - // can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. - // However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it - // will stop scheduling any new tasks when a task has failed. Any scheduled - // tasks will continue to completion. - PipelineFailurePolicy failure_policy = 4; - - // The runtime artifacts of the PipelineJob. The key will be the input - // artifact name and the value would be one of the InputArtifact. - map input_artifacts = 5; - } - - // 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.v1.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.v1.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.v1.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.v1.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.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 41fef466..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/pipeline_service.proto +++ /dev/null @@ -1,408 +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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - // * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - // * `NOT display_name="my_pipeline"` - // * `create_time>"2021-05-18T00:00:00Z"` - // * `training_task_definition:"*automl_text_classification*"` - 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`: 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; - - // Mask specifying which fields to read. - google.protobuf.FieldMask read_mask = 7; -} - -// 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 36096fd9..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/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.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 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.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/saved_query.proto b/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/saved_query.proto deleted file mode 100644 index 5332222d..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/saved_query.proto +++ /dev/null @@ -1,85 +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 = "SavedQueryProto"; -option java_package = "com.google.cloud.aiplatform.v1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; -option ruby_package = "Google::Cloud::AIPlatform::V1"; - -// A SavedQuery is a view of the dataset. It references a subset of annotations -// by problem type and filters. -message SavedQuery { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/SavedQuery" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}" - }; - - // Output only. Resource name of the SavedQuery. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the SavedQuery. - // 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]; - - // Some additional information about the SavedQuery. - google.protobuf.Value metadata = 12; - - // Output only. Timestamp when this SavedQuery was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when SavedQuery was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Filters on the Annotations in the dataset. - string annotation_filter = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Problem type of the SavedQuery. - // Allowed values: - // - // * IMAGE_CLASSIFICATION_SINGLE_LABEL - // * IMAGE_CLASSIFICATION_MULTI_LABEL - // * IMAGE_BOUNDING_POLY - // * IMAGE_BOUNDING_BOX - // * TEXT_CLASSIFICATION_SINGLE_LABEL - // * TEXT_CLASSIFICATION_MULTI_LABEL - // * TEXT_EXTRACTION - // * TEXT_SENTIMENT - // * VIDEO_CLASSIFICATION - // * VIDEO_OBJECT_TRACKING - string problem_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Number of AnnotationSpecs in the context of the SavedQuery. - int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform a consistent read-modify-write update. If not set, a blind - // "overwrite" update happens. - string etag = 8; - - // Output only. If the Annotations belonging to the SavedQuery can be used for AutoML - // training. - bool support_automl_training = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} 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 7ebb77ab..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.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.instance; - - -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 96aa4b14..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.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.instance; - - -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 95dbf98c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.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; - - -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 7d977a2f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/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.predict.instance; - - -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 b0b60c0f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.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; - - -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 15ded40b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/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.instance; - - -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 a43507dd..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto +++ /dev/null @@ -1,50 +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; - - -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 70318a60..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto +++ /dev/null @@ -1,50 +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; - - -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 26b34930..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto +++ /dev/null @@ -1,50 +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; - - -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 6aab8b46..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_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.params; - - -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 e957e2af..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.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.params; - - -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 5469108a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto +++ /dev/null @@ -1,35 +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; - - -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 ba6ec540..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.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.params; - - -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 f4325f8a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto +++ /dev/null @@ -1,63 +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; - - -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 82449062..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto +++ /dev/null @@ -1,42 +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; - - -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 be54f2c8..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto +++ /dev/null @@ -1,40 +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; - - -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 b0bb842e..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto +++ /dev/null @@ -1,50 +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"; - -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 20ff4f6d..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.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.prediction; - - -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 979461bd..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_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.prediction; - - -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 ba6bc6a7..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.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.prediction; - - -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 f74a82bf..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.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; - - -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 4e8d5ec2..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.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.prediction; - - -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 35aecb6c..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto +++ /dev/null @@ -1,53 +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"; - -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 fee01c7e..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto +++ /dev/null @@ -1,66 +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"; - -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 d445c0cc..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto +++ /dev/null @@ -1,81 +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"; - -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 0f2c1ea4..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.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.v1.schema.trainingjob.definition; - - -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 1459a85a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto +++ /dev/null @@ -1,119 +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; - - -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 8303ef69..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto +++ /dev/null @@ -1,105 +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; - - -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 5b43fc7b..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto +++ /dev/null @@ -1,283 +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/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.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 1713e6a6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.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.trainingjob.definition; - - -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 01f56c31..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.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.trainingjob.definition; - - -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 cb3f0ac5..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.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; - - -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 331033bd..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto +++ /dev/null @@ -1,61 +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; - - -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 194ea3c6..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto +++ /dev/null @@ -1,55 +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; - - -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 d97e356f..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto +++ /dev/null @@ -1,66 +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; - - -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 eaa3298a..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto +++ /dev/null @@ -1,42 +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; - - -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_saved_queries.jsinclude:samples/generated/v1beta1/dataset_service.list_annotations.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.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.write_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.upsert_datapoints.jsinclude:samples/generated/v1beta1/index_service.remove_datapoints.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.batch_import_model_evaluation_slices.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 c61a4a3f..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 HyperparameterTuningJob 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 HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported - // by HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported - // by HyperparameterTuningJob 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 - // HyperparameterTuningJob 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 a0de8cf4..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/aiplatform/v1/training_pipeline.proto +++ /dev/null @@ -1,413 +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; - - // 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.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDataset, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataset, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importData, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportData, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists SavedQueries 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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery}. - * 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 `listSavedQueriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSavedQueries( - request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.ISavedQuery[], - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest|null, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse - ]>; - listSavedQueries( - request: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISavedQuery>): void; - listSavedQueries( - request: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISavedQuery>): void; - listSavedQueries( - request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISavedQuery>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1.ISavedQuery>): - Promise<[ - protos.google.cloud.aiplatform.v1.ISavedQuery[], - protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest|null, - protos.google.cloud.aiplatform.v1.IListSavedQueriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSavedQueries(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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery} 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 `listSavedQueriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSavedQueriesStream( - request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSavedQueries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSavedQueries.createStream( - this.innerApiCalls.listSavedQueries as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSavedQueries`, 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 SavedQueries 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 - * [SavedQuery]{@link google.cloud.aiplatform.v1.SavedQuery}. 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_ListSavedQueries_async - */ - listSavedQueriesAsync( - request?: protos.google.cloud.aiplatform.v1.IListSavedQueriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSavedQueries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSavedQueries.asyncIterate( - this.innerApiCalls['listSavedQueries'] as GaxCall, - request as {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 69bc6d22..00000000 --- a/owl-bot-staging/v1/src/v1/dataset_service_client_config.json +++ /dev/null @@ -1,70 +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" - }, - "ListSavedQueries": { - "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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/dataset_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 ac1f69dd..00000000 --- a/owl-bot-staging/v1/src/v1/endpoint_service_client.ts +++ /dev/null @@ -1,3656 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new EndpointServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployModel, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployModel, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/endpoint_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 0b5ad3c0..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,2898 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FeaturestoreOnlineServingServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - - this.descriptors.longrunning = { - }; - - // 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 = this._gaxModule.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 this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity_type': request.entityType ?? '', - }); - this.initialize(); - return this.innerApiCalls.streamingReadFeatureValues(request, options); - } - -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 f703a73a..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_service_client.ts +++ /dev/null @@ -1,5806 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FeaturestoreServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeaturestore, this._gaxModule.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` - * * `online_serving_config.scaling` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFeaturestore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEntityType, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEntityType, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeature, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeature, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/featurestore_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 bc7d2508..00000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,2277 +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" - ] - }, - "ListSavedQueries": { - "methods": [ - "listSavedQueries", - "listSavedQueriesStream", - "listSavedQueriesAsync" - ] - }, - "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" - ] - }, - "ListSavedQueries": { - "methods": [ - "listSavedQueries", - "listSavedQueriesStream", - "listSavedQueriesAsync" - ] - }, - "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" - ] - }, - "UpsertDatapoints": { - "methods": [ - "upsertDatapoints" - ] - }, - "RemoveDatapoints": { - "methods": [ - "removeDatapoints" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "UpsertDatapoints": { - "methods": [ - "upsertDatapoints" - ] - }, - "RemoveDatapoints": { - "methods": [ - "removeDatapoints" - ] - }, - "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" - ] - }, - "BatchImportModelEvaluationSlices": { - "methods": [ - "batchImportModelEvaluationSlices" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "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" - ] - }, - "BatchImportModelEvaluationSlices": { - "methods": [ - "batchImportModelEvaluationSlices" - ] - }, - "GetModelEvaluation": { - "methods": [ - "getModelEvaluation" - ] - }, - "GetModelEvaluationSlice": { - "methods": [ - "getModelEvaluationSlice" - ] - }, - "UploadModel": { - "methods": [ - "uploadModel" - ] - }, - "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/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 5bf5c018..00000000 --- a/owl-bot-staging/v1/src/v1/index_endpoint_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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new IndexEndpointServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 3f3fc1e7..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_client.ts +++ /dev/null @@ -1,3529 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new IndexServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'upsertDatapoints', 'removeDatapoints']; - 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._opts.fallback - ); - - 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIndex(request, options, callback); - } -/** - * Add/update Datapoints into an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.index - * Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {number[]} request.datapoints - * A list of datapoints to be created/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 [UpsertDatapointsResponse]{@link google.cloud.aiplatform.v1.UpsertDatapointsResponse}. - * Please see 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_UpsertDatapoints_async - */ - upsertDatapoints( - request?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|undefined, {}|undefined - ]>; - upsertDatapoints( - request: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): void; - upsertDatapoints( - request: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): void; - upsertDatapoints( - request?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1.IUpsertDatapointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'index': request.index ?? '', - }); - this.initialize(); - return this.innerApiCalls.upsertDatapoints(request, options, callback); - } -/** - * Remove Datapoints from an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.index - * Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {string[]} request.datapointIds - * A list of datapoint ids to 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 [RemoveDatapointsResponse]{@link google.cloud.aiplatform.v1.RemoveDatapointsResponse}. - * Please see 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_RemoveDatapoints_async - */ - removeDatapoints( - request?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|undefined, {}|undefined - ]>; - removeDatapoints( - request: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): void; - removeDatapoints( - request: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): void; - removeDatapoints( - request?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1.IRemoveDatapointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'index': request.index ?? '', - }); - this.initialize(); - return this.innerApiCalls.removeDatapoints(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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndex, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 fb5e197f..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_client_config.json +++ /dev/null @@ -1,54 +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" - }, - "UpsertDatapoints": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveDatapoints": { - "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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/index_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 a062e176..00000000 --- a/owl-bot-staging/v1/src/v1/job_service_client.ts +++ /dev/null @@ -1,6087 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new JobServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/job_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 e6ee4c38..00000000 --- a/owl-bot-staging/v1/src/v1/metadata_service_client.ts +++ /dev/null @@ -1,6412 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MetadataServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMetadataStore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteArtifact, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeArtifacts, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteContext, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeContexts, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeExecutions, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/metadata_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 49eab312..00000000 --- a/owl-bot-staging/v1/src/v1/migration_service_client.ts +++ /dev/null @@ -1,3137 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MigrationServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchMigrateResources, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/migration_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 37378868..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_client.ts +++ /dev/null @@ -1,4688 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ModelServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 deleteModelVersionResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteModelVersionMetadata = 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)), - 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.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 = this._gaxModule.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', 'listModelVersions', 'updateModel', 'deleteModel', 'deleteModelVersion', 'mergeVersionAliases', 'exportModel', 'importModelEvaluation', 'batchImportModelEvaluationSlices', '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._opts.fallback - ); - - 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.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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-zA-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.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_MergeVersionAliases_async - */ - mergeVersionAliases( - request?: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|undefined, {}|undefined - ]>; - mergeVersionAliases( - request: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): void; - mergeVersionAliases( - request: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): void; - mergeVersionAliases( - request?: protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.IMergeVersionAliasesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel, - protos.google.cloud.aiplatform.v1.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' - ] = this._gaxModule.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.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.importModelEvaluation(request, options, callback); - } -/** - * Imports a list of externally generated ModelEvaluationSlice. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {number[]} request.modelEvaluationSlices - * Required. Model evaluation slice 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 [BatchImportModelEvaluationSlicesResponse]{@link google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse}. - * Please see 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_BatchImportModelEvaluationSlices_async - */ - batchImportModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined - ]>; - batchImportModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): void; - batchImportModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): void; - batchImportModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchImportModelEvaluationSlices(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' - ] = this._gaxModule.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' - ] = this._gaxModule.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.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.uploadModel, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModel, this._gaxModule.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.v1.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_v1_generated_ModelService_DeleteModelVersion_async - */ - deleteModelVersion( - request?: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteModelVersion( - request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelVersion( - request: protos.google.cloud.aiplatform.v1.IDeleteModelVersionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteModelVersion( - request?: protos.google.cloud.aiplatform.v1.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' - ] = this._gaxModule.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_v1_generated_ModelService_DeleteModelVersion_async - */ - async checkDeleteModelVersionProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelVersion, this._gaxModule.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. - * 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.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportModel, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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.v1.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.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 `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.v1.IListModelVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel[], - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest|null, - protos.google.cloud.aiplatform.v1.IListModelVersionsResponse - ]>; - listModelVersions( - request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): void; - listModelVersions( - request: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): void; - listModelVersions( - request?: protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest, - protos.google.cloud.aiplatform.v1.IListModelVersionsResponse|null|undefined, - protos.google.cloud.aiplatform.v1.IModel>): - Promise<[ - protos.google.cloud.aiplatform.v1.IModel[], - protos.google.cloud.aiplatform.v1.IListModelVersionsRequest|null, - protos.google.cloud.aiplatform.v1.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' - ] = this._gaxModule.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.v1.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.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 `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.v1.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' - ] = this._gaxModule.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 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.v1.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.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_ListModelVersions_async - */ - listModelVersionsAsync( - request?: protos.google.cloud.aiplatform.v1.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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 c067ea14..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_client_config.json +++ /dev/null @@ -1,86 +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" - }, - "ListModelVersions": { - "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" - }, - "DeleteModelVersion": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MergeVersionAliases": { - "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" - }, - "BatchImportModelEvaluationSlices": { - "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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/model_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 72a1c309..00000000 --- a/owl-bot-staging/v1/src/v1/pipeline_service_client.ts +++ /dev/null @@ -1,4057 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PipelineServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePipelineJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 {}, - 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`: 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 {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 [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' - ] = this._gaxModule.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`: 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 {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 [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' - ] = this._gaxModule.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 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`: 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 {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 - * [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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/pipeline_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 5eaa3ace..00000000 --- a/owl-bot-staging/v1/src/v1/prediction_service_client.ts +++ /dev/null @@ -1,3045 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PredictionServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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}' - ), - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - - this.descriptors.longrunning = { - }; - - // 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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'endpoint': request.endpoint ?? '', - }); - this.initialize(); - return this.innerApiCalls.explain(request, options, callback); - } - -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/prediction_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 a1363ad8..00000000 --- a/owl-bot-staging/v1/src/v1/specialist_pool_service_client.ts +++ /dev/null @@ -1,3378 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SpecialistPoolServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 0551bebd..00000000 --- a/owl-bot-staging/v1/src/v1/tensorboard_service_client.ts +++ /dev/null @@ -1,5882 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform, 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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TensorboardServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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 this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 930c57e4..00000000 --- a/owl-bot-staging/v1/src/v1/vizier_service_client.ts +++ /dev/null @@ -1,4208 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new VizierServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',additional_bindings: [{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1/{name=projects/*/locations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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. It must be positive. - * @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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.suggestTrials, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 d82a7a8b..00000000 --- a/owl-bot-staging/v1/src/v1/vizier_service_proto_list.json +++ /dev/null @@ -1,112 +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_failure_policy.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/saved_query.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 557a5755..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 0ecf1e67..00000000 --- a/owl-bot-staging/v1/test/gapic_dataset_service_v1.ts +++ /dev/null @@ -1,4569 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importData(request), expectedError); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importData(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportData(request), expectedError); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportData(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatasets(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataItems(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSavedQueries', () => { - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - ]; - client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); - const [response] = await client.listSavedQueries(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - ]; - client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSavedQueries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.ISavedQuery[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSavedQueries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSavedQueries(request), expectedError); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - ]; - client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSavedQueriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.SavedQuery[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.SavedQuery) => { - 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.listSavedQueries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); - assert( - (client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSavedQueriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1.SavedQuery[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1.SavedQuery) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); - assert( - (client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1.SavedQuery()), - ]; - client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.ISavedQuery[] = []; - const iterable = client.listSavedQueriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSavedQueriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1.ISavedQuery[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAnnotations(request), expectedError); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new datasetserviceModule.v1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 9e46f8e1..00000000 --- a/owl-bot-staging/v1/test/gapic_endpoint_service_v1.ts +++ /dev/null @@ -1,3726 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployModel(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEndpoints(request), expectedError); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new endpointserviceModule.v1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 f7d78101..00000000 --- a/owl-bot-staging/v1/test/gapic_featurestore_online_serving_service_v1.ts +++ /dev/null @@ -1,2783 +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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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 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.FeaturestoreOnlineServingServiceClient', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - 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('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 3181339f..00000000 --- a/owl-bot-staging/v1/test/gapic_featurestore_service_v1.ts +++ /dev/null @@ -1,5901 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEntityType(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEntityType(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeature(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateFeatures(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeature(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchReadFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchReadFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeaturestores(request), expectedError); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEntityTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 24a56ef1..00000000 --- a/owl-bot-staging/v1/test/gapic_index_endpoint_service_v1.ts +++ /dev/null @@ -1,3880 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexEndpoints(request), expectedError); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new indexendpointserviceModule.v1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 034673a4..00000000 --- a/owl-bot-staging/v1/test/gapic_index_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 indexserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndex(request), expectedError); - }); - }); - - describe('upsertDatapoints', () => { - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() - ); - client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); - const [response] = await client.upsertDatapoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() - ); - client.innerApiCalls.upsertDatapoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upsertDatapoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IUpsertDatapointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.upsertDatapoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.upsertDatapoints(request), expectedError); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.upsertDatapoints(request), expectedError); - }); - }); - - describe('removeDatapoints', () => { - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() - ); - client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); - const [response] = await client.removeDatapoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() - ); - client.innerApiCalls.removeDatapoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDatapoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IRemoveDatapointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDatapoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDatapoints(request), expectedError); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeDatapoints(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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexes(request), expectedError); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new indexserviceModule.v1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 3c286ae7..00000000 --- a/owl-bot-staging/v1/test/gapic_job_service_v1.ts +++ /dev/null @@ -1,6771 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.pauseModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.resumeModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCustomJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataLabelingJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteHyperparameterTuningJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBatchPredictionJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataLabelingJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBatchPredictionJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new jobserviceModule.v1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 a92a2169..00000000 --- a/owl-bot-staging/v1/test/gapic_metadata_service_v1.ts +++ /dev/null @@ -1,7088 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createContext(request), expectedError); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getContext(request), expectedError); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateContext(request), expectedError); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextChildren(request), expectedError); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addExecutionEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMetadataSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteArtifact(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeArtifacts(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeArtifacts(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteContext(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteContext(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeContexts(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeContexts(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeExecutions(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataStores(request), expectedError); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listArtifacts(request), expectedError); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listContexts(request), expectedError); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataSchemas(request), expectedError); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new metadataserviceModule.v1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 edf9e728..00000000 --- a/owl-bot-staging/v1/test/gapic_migration_service_v1.ts +++ /dev/null @@ -1,3044 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchMigrateResources(request), expectedError); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchMigrateResources(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchMigratableResources(request), expectedError); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new migrationserviceModule.v1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 399a6ade..00000000 --- a/owl-bot-staging/v1/test/gapic_model_service_v1.ts +++ /dev/null @@ -1,5001 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModel(request), expectedError); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateModel(request), expectedError); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - 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.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.Model() - ); - client.innerApiCalls.mergeVersionAliases = stubSimpleCall(expectedResponse); - const [response] = await client.mergeVersionAliases(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.Model() - ); - client.innerApiCalls.mergeVersionAliases = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mergeVersionAliases( - 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); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.mergeVersionAliases(request), expectedError); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mergeVersionAliases 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.MergeVersionAliasesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - 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.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.importModelEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.importModelEvaluation(request), expectedError); - }); - }); - - describe('batchImportModelEvaluationSlices', () => { - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() - ); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(expectedResponse); - const [response] = await client.batchImportModelEvaluationSlices(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() - ); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchImportModelEvaluationSlices( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1.IBatchImportModelEvaluationSlicesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchImportModelEvaluationSlices(request), expectedError); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchImportModelEvaluationSlices(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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.uploadModel(request), expectedError); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.uploadModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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('deleteModelVersion', () => { - it('invokes deleteModelVersion 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.DeleteModelVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteModelVersion 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.DeleteModelVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteModelVersion 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.DeleteModelVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteModelVersion 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.DeleteModelVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteModelVersionProgress 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.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.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.checkDeleteModelVersionProgress(''), 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportModel(request), expectedError); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModels(request), expectedError); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listModelVersions', () => { - it('invokes listModelVersions 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;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.listModelVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listModelVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listModelVersions 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;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.listModelVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listModelVersions( - 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); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listModelVersions 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listModelVersionsStream 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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.listModelVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listModelVersionsStream(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.listModelVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); - assert( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listModelVersionsStream 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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.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.listModelVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listModelVersions, request)); - assert( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listModelVersions 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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.listModelVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1.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( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listModelVersions 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.ListModelVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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.v1.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( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluations(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluationSlices(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new modelserviceModule.v1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 56a33880..00000000 --- a/owl-bot-staging/v1/test/gapic_pipeline_service_v1.ts +++ /dev/null @@ -1,4091 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.cancelTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTrainingPipeline(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deletePipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deletePipelineJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrainingPipelines(request), expectedError); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPipelineJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new pipelineserviceModule.v1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 aef55fde..00000000 --- a/owl-bot-staging/v1/test/gapic_prediction_service_v1.ts +++ /dev/null @@ -1,2888 +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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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 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.PredictionServiceClient', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.predict(request), expectedError); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); - const [response] = await client.rawPredict(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rawPredict(request), expectedError); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.explain(request), expectedError); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.explain(request), expectedError); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new predictionserviceModule.v1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 5e250898..00000000 --- a/owl-bot-staging/v1/test/gapic_specialist_pool_service_v1.ts +++ /dev/null @@ -1,3464 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecialistPools(request), expectedError); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 60e6bb98..00000000 --- a/owl-bot-staging/v1/test/gapic_tensorboard_service_v1.ts +++ /dev/null @@ -1,6677 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardExperiment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardRun(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardTimeSeries(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboards(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardExperiments(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardRuns(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 1983bc26..00000000 --- a/owl-bot-staging/v1/test/gapic_vizier_service_v1.ts +++ /dev/null @@ -1,4631 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); - const [response] = await client.deleteStudy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTrial(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.stopTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOptimalTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.suggestTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.suggestTrials(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.checkTrialEarlyStoppingState(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listStudies(request), expectedError); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new vizierserviceModule.v1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 c2413ad5..00000000 --- a/owl-bot-staging/v1beta1/package.json +++ /dev/null @@ -1,79 +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", - "deployment resource pool 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/ && minifyProtoJson", - "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": "^3.5.1" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.59", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.1", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.1", - "jsdoc-region-tag": "^2.0.1", - "linkinator": "^4.0.3", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.8.3", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} 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 5141dfa2..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/batch_prediction_job.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/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/model_deployment_monitoring_job.proto"; -import "google/cloud/aiplatform/v1beta1/model_monitoring.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. - // - // The model resource name may contain version id or version alias to specify - // the version, if no version is specified, the default version will be used. - 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; - - // Model monitoring config will be used for analysis model behaviors, based on - // the input and output to the batch prediction job, as well as the provided - // training dataset. - ModelMonitoringConfig model_monitoring_config = 26; - - // Get batch prediction job monitoring statistics. - repeated ModelMonitoringStatsAnomalies model_monitoring_stats_anomalies = 31; - - // Output only. The running status of the model monitoring pipeline. - google.rpc.Status model_monitoring_status = 32 [(google.api.field_behavior) = OUTPUT_ONLY]; -} 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 f784eda4..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/completion_stats.proto +++ /dev/null @@ -1,48 +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]; - - // Output only. The number of the successful forecast points that are generated by the - // forecasting model. This is ONLY used by the forecasting batch prediction. - int64 successful_forecast_point_count = 5 [(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 ad66542d..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/custom_job.proto +++ /dev/null @@ -1,280 +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/env_var.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: 15 -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; - - // Optional. 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.field_behavior) = OPTIONAL, - (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; - - // 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/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 3be59c05..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/dataset_service.proto +++ /dev/null @@ -1,461 +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/cloud/aiplatform/v1beta1/saved_query.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"; - } - - // Lists SavedQueries in a Dataset. - rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/datasets/*}/savedQueries" - }; - 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.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries]. -message ListSavedQueriesRequest { - // Required. The resource name of the Dataset to list SavedQueries 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.ListSavedQueries][google.cloud.aiplatform.v1beta1.DatasetService.ListSavedQueries]. -message ListSavedQueriesResponse { - // A list of SavedQueries that match the specified filter in the request. - repeated SavedQuery saved_queries = 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/deployment_resource_pool.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto deleted file mode 100644 index 2249e655..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto +++ /dev/null @@ -1,50 +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 = "DeploymentResourcePoolProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A description of resources that can be shared by multiple DeployedModels, -// whose underlying specification consists of a DedicatedResources. -message DeploymentResourcePool { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/DeploymentResourcePool" - pattern: "projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}" - }; - - // Output only. The resource name of the DeploymentResourcePool. - // Format: - // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The underlying DedicatedResources that the DeploymentResourcePool uses. - DedicatedResources dedicated_resources = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Timestamp when this DeploymentResourcePool was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto deleted file mode 100644 index 11eddf67..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto +++ /dev/null @@ -1,219 +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/deployed_model_ref.proto"; -import "google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto"; -import "google/cloud/aiplatform/v1beta1/endpoint.proto"; -import "google/cloud/aiplatform/v1beta1/operation.proto"; -import "google/longrunning/operations.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 = "DeploymentResourcePoolServiceProto"; -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 manages the DeploymentResourcePool resource. -service DeploymentResourcePoolService { - option (google.api.default_host) = "aiplatform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a DeploymentResourcePool. - rpc CreateDeploymentResourcePool(CreateDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" - body: "*" - }; - option (google.api.method_signature) = "parent,deployment_resource_pool,deployment_resource_pool_id"; - option (google.longrunning.operation_info) = { - response_type: "DeploymentResourcePool" - metadata_type: "CreateDeploymentResourcePoolOperationMetadata" - }; - } - - // Get a DeploymentResourcePool. - rpc GetDeploymentResourcePool(GetDeploymentResourcePoolRequest) returns (DeploymentResourcePool) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List DeploymentResourcePools in a location. - rpc ListDeploymentResourcePools(ListDeploymentResourcePoolsRequest) returns (ListDeploymentResourcePoolsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" - }; - option (google.api.method_signature) = "parent"; - } - - // Delete a DeploymentResourcePool. - rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "DeleteOperationMetadata" - }; - } - - // List DeployedModels that have been deployed on this DeploymentResourcePool. - rpc QueryDeployedModels(QueryDeployedModelsRequest) returns (QueryDeployedModelsResponse) { - option (google.api.http) = { - get: "/v1beta1/{deployment_resource_pool=projects/*/locations/*/deploymentResourcePools/*}:queryDeployedModels" - }; - option (google.api.method_signature) = "deployment_resource_pool"; - } -} - -// Request message for CreateDeploymentResourcePool method. -message CreateDeploymentResourcePoolRequest { - // Required. The parent location resource where this DeploymentResourcePool will 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 DeploymentResourcePool to create. - DeploymentResourcePool deployment_resource_pool = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the DeploymentResourcePool, which - // will become the final component of the DeploymentResourcePool's resource - // name. - // - // The maximum length is 63 characters, and valid characters - // are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. - string deployment_resource_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Runtime operation information for CreateDeploymentResourcePool method. -message CreateDeploymentResourcePoolOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for GetDeploymentResourcePool method. -message GetDeploymentResourcePoolRequest { - // Required. The name of the DeploymentResourcePool to retrieve. - // Format: - // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DeploymentResourcePool" - } - ]; -} - -// Request message for ListDeploymentResourcePools method. -message ListDeploymentResourcePoolsRequest { - // Required. The parent Location which owns this collection of DeploymentResourcePools. - // Format: projects/{project}/locations/{location} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of DeploymentResourcePools to return. The service may - // return fewer than this value. - int32 page_size = 2; - - // A page token, received from a previous `ListDeploymentResourcePools` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListDeploymentResourcePools` must match the call that provided the page - // token. - string page_token = 3; -} - -// Response message for ListDeploymentResourcePools method. -message ListDeploymentResourcePoolsResponse { - // The DeploymentResourcePools from the specified location. - repeated DeploymentResourcePool deployment_resource_pools = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Runtime operation information for UpdateDeploymentResourcePool method. -message UpdateDeploymentResourcePoolOperationMetadata { - // The operation generic information. - GenericOperationMetadata generic_metadata = 1; -} - -// Request message for DeleteDeploymentResourcePool method. -message DeleteDeploymentResourcePoolRequest { - // Required. The name of the DeploymentResourcePool to delete. - // Format: - // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DeploymentResourcePool" - } - ]; -} - -// Request message for QueryDeployedModels method. -message QueryDeployedModelsRequest { - // Required. The name of the target DeploymentResourcePool to query. - // Format: - // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - string deployment_resource_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of DeployedModels to return. The service may return - // fewer than this value. - int32 page_size = 2; - - // A page token, received from a previous `QueryDeployedModels` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `QueryDeployedModels` must match the call that provided the page - // token. - string page_token = 3; -} - -// Response message for QueryDeployedModels method. -message QueryDeployedModelsResponse { - // DEPRECATED Use deployed_model_refs instead. - repeated DeployedModel deployed_models = 1 [deprecated = true]; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // References to the DeployedModels that share the specified - // deploymentResourcePool. - repeated DeployedModelRef deployed_model_refs = 3; -} 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 0236e532..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ /dev/null @@ -1,262 +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; - - // The resource name of the shared DeploymentResourcePool to deploy on. - // Format: - // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - string shared_resources = 17 [(google.api.resource_reference) = { - type: "aiplatform.googleapis.com/DeploymentResourcePool" - }]; - } - - // 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 resource 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. - // - // The resource name may contain version id or version alias to specify the - // version, if no version is specified, the default version will be deployed. - 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 6dccd06e..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]; - - // Optional. Metadata describing the Model's input and output for explanation. - ExplanationMetadata metadata = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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_indices 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 - Presets presets = 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 Presets { - // 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 5f7cbd14..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ /dev/null @@ -1,273 +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"; - } - - // Writes Feature values of one or more entities of an EntityType. - // - // The Feature values are merged into existing entities if any. The Feature - // values to be written must have timestamp within the online storage - // retention. - rpc WriteFeatureValues(WriteFeatureValuesRequest) returns (WriteFeatureValuesResponse) { - option (google.api.http) = { - post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues" - body: "*" - }; - option (google.api.method_signature) = "entity_type,payloads"; - } -} - -// Request message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. -message WriteFeatureValuesRequest { - // Required. The resource name of the EntityType for the entities being written. - // Value format: `projects/{project}/locations/{location}/featurestores/ - // {featurestore}/entityTypes/{entityType}`. For example, - // for a machine learning model predicting user clicks on a website, an - // EntityType ID could be `user`. - string entity_type = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/EntityType" - } - ]; - - // Required. The entities to be written. Up to 100,000 feature values can be written - // across all `payloads`. - repeated WriteFeatureValuesPayload payloads = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains Feature values to be written for a specific entity. -message WriteFeatureValuesPayload { - // Required. The ID of the entity. - string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Feature values to be written, mapping from Feature ID to value. Up to - // 100,000 `feature_values` entries may be written across all payloads. The - // feature generation time, aligned by days, must be no older than five - // years (1825 days) and no later than one year (366 days) in the future. - map feature_values = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. -message WriteFeatureValuesResponse { - -} - -// 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. -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 7deb3593..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/featurestore_service.proto +++ /dev/null @@ -1,1226 +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` - // * `online_serving_config.scaling` - 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 f0e3c67a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index.proto +++ /dev/null @@ -1,172 +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}" - }; - - // The update method of an Index. - enum IndexUpdateMethod { - // Should not be used. - INDEX_UPDATE_METHOD_UNSPECIFIED = 0; - - // BatchUpdate: user can call UpdateIndex with files on Cloud Storage of - // datapoints to update. - BATCH_UPDATE = 1; - - // StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update - // the Index and the updates will be applied in corresponding - // DeployedIndexes in nearly real-time. - STREAM_UPDATE = 2; - } - - // 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]; - - // Output only. Stats of the index resource. - IndexStats index_stats = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The update method to use with this Index. If not set, BATCH_UPDATE will be - // used by default. - IndexUpdateMethod index_update_method = 16 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A datapoint of Index. -message IndexDatapoint { - // Restriction of a datapoint which describe its attributes(tokens) from each - // of several attribute categories(namespaces). - message Restriction { - // The namespace of this restriction. eg: color. - string namespace = 1; - - // The attributes to allow in this namespace. eg: 'red' - repeated string allow_list = 2; - - // The attributes to deny in this namespace. eg: 'blue' - repeated string deny_list = 3; - } - - // Crowding tag is a constraint on a neighbor list produced by nearest - // neighbor search requiring that no more than some value k' of the k - // neighbors returned have the same value of crowding_attribute. - message CrowdingTag { - // The attribute value used for crowding. The maximum number of neighbors - // to return per crowding attribute value - // (per_crowding_attribute_num_neighbors) is configured per-query. This - // field is ignored if per_crowding_attribute_num_neighbors is larger than - // the total number of neighbors to return for a given query. - string crowding_attribute = 1; - } - - // Required. Unique identifier of the datapoint. - string datapoint_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Feature embedding vector. An array of numbers with the length of - // [NearestNeighborSearchConfig.dimensions]. - repeated float feature_vector = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. List of Restrict of the datapoint, used to perform "restricted searches" - // where boolean rule are used to filter the subset of the database eligible - // for matching. - // See: https://cloud.google.com/vertex-ai/docs/matching-engine/filtering - repeated Restriction restricts = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. CrowdingTag of the datapoint, the number of neighbors to return in each - // crowding can be configured during query. - CrowdingTag crowding_tag = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Stats of the Index. -message IndexStats { - // Output only. The number of vectors in the Index. - int64 vectors_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of shards in the Index. - int32 shards_count = 2 [(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 813f648c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/index_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.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" - }; - } - - // Add/update Datapoints into an Index. - rpc UpsertDatapoints(UpsertDatapointsRequest) returns (UpsertDatapointsResponse) { - option (google.api.http) = { - post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:upsertDatapoints" - body: "*" - }; - } - - // Remove Datapoints from an Index. - rpc RemoveDatapoints(RemoveDatapointsRequest) returns (RemoveDatapointsResponse) { - option (google.api.http) = { - post: "/v1beta1/{index=projects/*/locations/*/indexes/*}:removeDatapoints" - body: "*" - }; - } -} - -// 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" - } - ]; -} - -// Request message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] -message UpsertDatapointsRequest { - // Required. The name of the Index resource to be updated. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string index = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // A list of datapoints to be created/updated. - repeated IndexDatapoint datapoints = 2; -} - -// Response message for [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] -message UpsertDatapointsResponse { - -} - -// Request message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] -message RemoveDatapointsRequest { - // Required. The name of the Index resource to be updated. - // Format: - // `projects/{project}/locations/{location}/indexes/{index}` - string index = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "aiplatform.googleapis.com/Index" - } - ]; - - // A list of datapoint ids to be deleted. - repeated string datapoint_ids = 2; -} - -// Response message for [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] -message RemoveDatapointsResponse { - -} - -// 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 48cf08aa..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/job_service.proto +++ /dev/null @@ -1,1008 +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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 `=`, `!=` comparisons, and `:` wildcard. - // * `model_display_name` supports `=`, `!=` comparisons. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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. - // - // Supported fields: - // - // * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - // * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - // * `NOT display_name="my_job"` - // * `create_time>"2021-05-18T00:00:00Z"` - 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 5498d89d..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 64. - 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 ba9b2cd5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model.proto +++ /dev/null @@ -1,592 +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; - - // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1beta1.DeployedModel]. - // A pre-configured [DeploymentResourcePool][google.cloud.aiplatform.v1beta1.DeploymentResourcePool] is required. - SHARED_RESOURCES = 3; - } - - // 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 0446c1cc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_deployment_monitoring_job.proto +++ /dev/null @@ -1,310 +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]; - - // The time window of the prediction data being included in each prediction - // dataset. This window specifies how long the data should be collected from - // historical model results for each run. If not set, - // [ModelDeploymentMonitoringScheduleConfig.monitor_interval][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringScheduleConfig.monitor_interval] will be used. - // e.g. If currently the cutoff time is 2022-01-08 14:30:00 and the - // monitor_window is set to be 3600, then data from 2022-01-08 13:30:00 - // to 2022-01-08 14:30:00 will be retrieved and aggregated to calculate the - // monitoring statistics. - google.protobuf.Duration monitor_window = 2; -} - -// 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 3dc687e5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_monitoring.proto +++ /dev/null @@ -1,239 +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"; - -// The model monitoring configuration used for Batch Prediction Job. -message ModelMonitoringConfig { - // Model monitoring objective config. - repeated ModelMonitoringObjectiveConfig objective_configs = 3; - - // Model monitoring alert config. - ModelMonitoringAlertConfig alert_config = 2; - - // YAML schema file uri in Cloud Storage describing the format of a single - // instance that you want Tensorflow Data Validation (TFDV) to analyze. - // - // 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 = 4; - - // A Google Cloud Storage location for batch prediction model monitoring to - // dump statistics and anomalies. - // If not provided, a folder will be created in customer project to hold - // statistics and anomalies. - GcsDestination stats_anomalies_base_directory = 5; -} - -// The objective configuration for model monitoring, including the information -// needed to detect anomalies for one particular model. -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. - // "jsonl" - // The source file is a JSONL 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; - - // Skew anomaly detection threshold used by all features. - // When the per-feature thresholds are not set, this field can be used to - // specify a threshold for all features. - ThresholdConfig default_skew_threshold = 6; - } - - // 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; - - // Drift anomaly detection threshold used by all features. - // When the per-feature thresholds are not set, this field can be used to - // specify a threshold for all features. - ThresholdConfig default_drift_threshold = 5; - } - - // 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; -} - -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. -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. -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 1af9d4b4..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ /dev/null @@ -1,693 +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"; - } - - // Incrementally update the dataset used for an 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"; - } - - // Imports a list of externally generated ModelEvaluationSlice. - rpc BatchImportModelEvaluationSlices(BatchImportModelEvaluationSlicesRequest) returns (BatchImportModelEvaluationSlicesResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices:batchImport" - body: "*" - }; - option (google.api.method_signature) = "parent,model_evaluation_slices"; - } - - // 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-zA-Z0-9-]{0,126}[a-z-0-9]`. - // Add the `-` prefix to an alias means removing that alias from the version. - // `-` is NOT counted in the 128 characters. Example: `-golden` means removing - // the `golden` alias from the version. - // - // There is NO ordering in aliases, which means - // 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.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices] -message BatchImportModelEvaluationSlicesRequest { - // Required. The name of the parent ModelEvaluation resource. - // 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" - } - ]; - - // Required. Model evaluation slice resource to be imported. - repeated ModelEvaluationSlice model_evaluation_slices = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for [ModelService.BatchImportModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.BatchImportModelEvaluationSlices] -message BatchImportModelEvaluationSlicesResponse { - // Output only. List of imported [ModelEvaluationSlice.name][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.name]. - repeated string imported_model_evaluation_slices = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// 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_failure_policy.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.proto deleted file mode 100644 index f197f510..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_failure_policy.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; - -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 = "PipelineFailurePolicyProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// Represents the failure policy of a pipeline. Currently, the default of a -// pipeline is that the pipeline will continue to run until no more tasks can be -// executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. However, if a -// pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling -// any new tasks when a task has failed. Any scheduled tasks will continue to -// completion. -enum PipelineFailurePolicy { - // Default value, and follows fail slow behavior. - PIPELINE_FAILURE_POLICY_UNSPECIFIED = 0; - - // Indicates that the pipeline should continue to run until all possible - // tasks have been scheduled and completed. - PIPELINE_FAILURE_POLICY_FAIL_SLOW = 1; - - // Indicates that the pipeline should stop scheduling new tasks after a task - // has failed. - PIPELINE_FAILURE_POLICY_FAIL_FAST = 2; -} 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 9cb69a90..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_job.proto +++ /dev/null @@ -1,349 +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_failure_policy.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; - - // Represents the failure policy of a pipeline. Currently, the default of a - // pipeline is that the pipeline will continue to run until no more tasks - // can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW. - // However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it - // will stop scheduling any new tasks when a task has failed. Any scheduled - // tasks will continue to completion. - PipelineFailurePolicy failure_policy = 4; - } - - // 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 d66c7843..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/pipeline_service.proto +++ /dev/null @@ -1,405 +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 `=`, `!=` comparisons, and `:` wildcard. - // * `state` supports `=`, `!=` comparisons. - // * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - // * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - // `create_time` must be in RFC 3339 format. - // - // Some examples of using the filter are: - // - // * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - // * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - // * `NOT display_name="my_pipeline"` - // * `create_time>"2021-05-18T00:00:00Z"` - // * `training_task_definition:"*automl_text_classification*"` - 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`: 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/saved_query.proto b/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto deleted file mode 100644 index da02d8a5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/saved_query.proto +++ /dev/null @@ -1,85 +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 = "SavedQueryProto"; -option java_package = "com.google.cloud.aiplatform.v1beta1"; -option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; -option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; - -// A SavedQuery is a view of the dataset. It references a subset of annotations -// by problem type and filters. -message SavedQuery { - option (google.api.resource) = { - type: "aiplatform.googleapis.com/SavedQuery" - pattern: "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}" - }; - - // Output only. Resource name of the SavedQuery. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The user-defined name of the SavedQuery. - // 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]; - - // Some additional information about the SavedQuery. - google.protobuf.Value metadata = 12; - - // Output only. Timestamp when this SavedQuery was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp when SavedQuery was last updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Filters on the Annotations in the dataset. - string annotation_filter = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Problem type of the SavedQuery. - // Allowed values: - // - // * IMAGE_CLASSIFICATION_SINGLE_LABEL - // * IMAGE_CLASSIFICATION_MULTI_LABEL - // * IMAGE_BOUNDING_POLY - // * IMAGE_BOUNDING_BOX - // * TEXT_CLASSIFICATION_SINGLE_LABEL - // * TEXT_CLASSIFICATION_MULTI_LABEL - // * TEXT_EXTRACTION - // * TEXT_SENTIMENT - // * VIDEO_CLASSIFICATION - // * VIDEO_OBJECT_TRACKING - string problem_type = 6 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Number of AnnotationSpecs in the context of the SavedQuery. - int32 annotation_spec_count = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Used to perform a consistent read-modify-write update. If not set, a blind - // "overwrite" update happens. - string etag = 8; - - // Output only. If the Annotations belonging to the SavedQuery can be used for AutoML - // training. - bool support_automl_training = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} 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 249c5ca3..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_payload.proto +++ /dev/null @@ -1,230 +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"; - -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 5a4b9767..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/annotation_spec_color.proto +++ /dev/null @@ -1,42 +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"; - -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 6f8b3eff..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/data_item_payload.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; - -import "google/api/field_behavior.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 d35bbc33..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/dataset_metadata.proto +++ /dev/null @@ -1,126 +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; - - -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 5dd708e3..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/geometry.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; - - -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 7ce0a344..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_classification.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.instance; - - -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 b92db336..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_object_detection.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.instance; - - -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 a83b7fbc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/image_segmentation.proto +++ /dev/null @@ -1,38 +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; - - -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 99b8deda..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/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.predict.instance; - - -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 0265e4c0..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/text_extraction.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; - - -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 17480d0c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/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.instance; - - -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 f65c6d2b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_action_recognition.proto +++ /dev/null @@ -1,50 +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; - - -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 9261a240..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_classification.proto +++ /dev/null @@ -1,50 +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; - - -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 6a420074..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/instance/video_object_tracking.proto +++ /dev/null @@ -1,50 +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; - - -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 088f0495..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_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.params; - - -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 32861f2b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_object_detection.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.params; - - -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 a49c8136..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/image_segmentation.proto +++ /dev/null @@ -1,35 +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; - - -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 02e8ec9f..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_action_recognition.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.params; - - -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 c93ccb6b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_classification.proto +++ /dev/null @@ -1,63 +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; - - -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 25c91dd7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/params/video_object_tracking.proto +++ /dev/null @@ -1,42 +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; - - -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 b7b6d3db..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/classification.proto +++ /dev/null @@ -1,40 +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; - - -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 a5489b1b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_object_detection.proto +++ /dev/null @@ -1,50 +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"; - -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 77629ccf..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/image_segmentation.proto +++ /dev/null @@ -1,44 +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; - - -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 1616dfca..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_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.prediction; - - -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 0aa04bdd..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/tabular_regression.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.prediction; - - -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 e7c0cffc..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_extraction.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; - - -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 b5b7a145..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/text_sentiment.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.v1beta1.schema.predict.prediction; - - -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 e2db5812..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/time_series_forecasting.proto +++ /dev/null @@ -1,32 +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; - - -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 86ff341c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_action_recognition.proto +++ /dev/null @@ -1,53 +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"; - -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 6cff9762..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_classification.proto +++ /dev/null @@ -1,66 +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"; - -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 11e28a9a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/predict/prediction/video_object_tracking.proto +++ /dev/null @@ -1,81 +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"; - -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 1b874b03..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_classification.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.trainingjob.definition; - - -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 938ece40..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_object_detection.proto +++ /dev/null @@ -1,119 +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; - - -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 e368e00b..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_image_segmentation.proto +++ /dev/null @@ -1,105 +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; - - -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 5488f747..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_tables.proto +++ /dev/null @@ -1,283 +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"; - -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 b57492a5..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_classification.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.v1beta1.schema.trainingjob.definition; - - -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 a367486a..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_extraction.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.v1beta1.schema.trainingjob.definition; - - -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 b63162d7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_text_sentiment.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; - - -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 596d0abd..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_time_series_forecasting.proto +++ /dev/null @@ -1,286 +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"; - -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 ef5284b7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_action_recognition.proto +++ /dev/null @@ -1,61 +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; - - -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 c6e15229..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_classification.proto +++ /dev/null @@ -1,55 +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; - - -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 7d929d20..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/automl_video_object_tracking.proto +++ /dev/null @@ -1,66 +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; - - -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 b88d0c4f..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/export_evaluated_data_items_config.proto +++ /dev/null @@ -1,42 +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; - - -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_saved_queries.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.upsert_datapoints.jsinclude:samples/generated/v1/index_service.remove_datapoints.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.merge_version_aliases.jsinclude:samples/generated/v1/model_service.import_model_evaluation.jsinclude:samples/generated/v1/model_service.batch_import_model_evaluation_slices.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.delete_model_version.jsinclude:samples/generated/v1/model_service.delete_model_version.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_versions.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 b2595c68..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 HyperparameterTuningJob 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 HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported - // by HyperparameterTuningJob 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 Vertex AI Vizier service. Not supported - // by HyperparameterTuningJob 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 - // HyperparameterTuningJob 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 138fbc3c..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/aiplatform/v1beta1/training_pipeline.proto +++ /dev/null @@ -1,413 +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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDataset, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataset, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importData, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportData, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists SavedQueries 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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery}. - * 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 `listSavedQueriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSavedQueries( - request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISavedQuery[], - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse - ]>; - listSavedQueries( - request: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): void; - listSavedQueries( - request: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): void; - listSavedQueries( - request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISavedQuery>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.ISavedQuery>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.ISavedQuery[], - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listSavedQueries(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 SavedQueries 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 [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery} 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 `listSavedQueriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listSavedQueriesStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSavedQueries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSavedQueries.createStream( - this.innerApiCalls.listSavedQueries as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSavedQueries`, 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 SavedQueries 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 - * [SavedQuery]{@link google.cloud.aiplatform.v1beta1.SavedQuery}. 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_ListSavedQueries_async - */ - listSavedQueriesAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListSavedQueriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSavedQueries']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSavedQueries.asyncIterate( - this.innerApiCalls['listSavedQueries'] as GaxCall, - request as {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 6ddf573c..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_client_config.json +++ /dev/null @@ -1,80 +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" - }, - "ListSavedQueries": { - "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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataset_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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/deployment_resource_pool_service_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts deleted file mode 100644 index 2d6975bf..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client.ts +++ /dev/null @@ -1,3556 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/deployment_resource_pool_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './deployment_resource_pool_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * A service that manages the DeploymentResourcePool resource. - * @class - * @memberof v1beta1 - */ -export class DeploymentResourcePoolServiceClient { - 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - deploymentResourcePoolServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DeploymentResourcePoolServiceClient. - * - * @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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DeploymentResourcePoolServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DeploymentResourcePoolServiceClient; - 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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 = { - listDeploymentResourcePools: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deploymentResourcePools'), - queryDeployedModels: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'deployedModels') - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createDeploymentResourcePoolResponse = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeploymentResourcePool') as gax.protobuf.Type; - const createDeploymentResourcePoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolOperationMetadata') as gax.protobuf.Type; - const deleteDeploymentResourcePoolResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteDeploymentResourcePoolMetadata = protoFilesRoot.lookup( - '.google.cloud.aiplatform.v1beta1.DeleteOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createDeploymentResourcePoolResponse.decode.bind(createDeploymentResourcePoolResponse), - createDeploymentResourcePoolMetadata.decode.bind(createDeploymentResourcePoolMetadata)), - deleteDeploymentResourcePool: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteDeploymentResourcePoolResponse.decode.bind(deleteDeploymentResourcePoolResponse), - deleteDeploymentResourcePoolMetadata.decode.bind(deleteDeploymentResourcePoolMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService', 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 = this._gaxModule.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.deploymentResourcePoolServiceStub) { - return this.deploymentResourcePoolServiceStub; - } - - // Put together the "service stub" for - // google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService. - this.deploymentResourcePoolServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService, - 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 deploymentResourcePoolServiceStubMethods = - ['createDeploymentResourcePool', 'getDeploymentResourcePool', 'listDeploymentResourcePools', 'deleteDeploymentResourcePool', 'queryDeployedModels']; - for (const methodName of deploymentResourcePoolServiceStubMethods) { - const callPromise = this.deploymentResourcePoolServiceStub.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._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.deploymentResourcePoolServiceStub; - } - - /** - * 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 -- - // ------------------- -/** - * Get a DeploymentResourcePool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DeploymentResourcePool to retrieve. - * Format: - * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. - * Please see 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_DeploymentResourcePoolService_GetDeploymentResourcePool_async - */ - getDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|undefined, {}|undefined - ]>; - getDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, - {}|null|undefined>): void; - getDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, - {}|null|undefined>): void; - getDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool, - protos.google.cloud.aiplatform.v1beta1.IGetDeploymentResourcePoolRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getDeploymentResourcePool(request, options, callback); - } - -/** - * Create a DeploymentResourcePool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent location resource where this DeploymentResourcePool will be - * created. Format: projects/{project}/locations/{location} - * @param {google.cloud.aiplatform.v1beta1.DeploymentResourcePool} request.deploymentResourcePool - * Required. The DeploymentResourcePool to create. - * @param {string} request.deploymentResourcePoolId - * Required. The ID to use for the DeploymentResourcePool, which - * will become the final component of the DeploymentResourcePool's resource - * name. - * - * The maximum length is 63 characters, and valid characters - * are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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_DeploymentResourcePoolService_CreateDeploymentResourcePool_async - */ - createDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.ICreateDeploymentResourcePoolRequest, - 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.createDeploymentResourcePool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createDeploymentResourcePool()`. - * @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_DeploymentResourcePoolService_CreateDeploymentResourcePool_async - */ - async checkCreateDeploymentResourcePoolProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createDeploymentResourcePool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Delete a DeploymentResourcePool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DeploymentResourcePool to delete. - * Format: - * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_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 - * 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_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async - */ - deleteDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDeploymentResourcePool( - request: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteDeploymentResourcePool( - request?: protos.google.cloud.aiplatform.v1beta1.IDeleteDeploymentResourcePoolRequest, - 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.deleteDeploymentResourcePool(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteDeploymentResourcePool()`. - * @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_DeploymentResourcePoolService_DeleteDeploymentResourcePool_async - */ - async checkDeleteDeploymentResourcePoolProgress(name: string): Promise>{ - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDeploymentResourcePool, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * List DeploymentResourcePools in a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent Location which owns this collection of DeploymentResourcePools. - * Format: projects/{project}/locations/{location} - * @param {number} request.pageSize - * The maximum number of DeploymentResourcePools to return. The service may - * return fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `ListDeploymentResourcePools` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDeploymentResourcePools` 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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. - * 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 `listDeploymentResourcePoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDeploymentResourcePools( - request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[], - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse - ]>; - listDeploymentResourcePools( - request: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): void; - listDeploymentResourcePools( - request: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): void; - listDeploymentResourcePools( - request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[], - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.listDeploymentResourcePools(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 Location which owns this collection of DeploymentResourcePools. - * Format: projects/{project}/locations/{location} - * @param {number} request.pageSize - * The maximum number of DeploymentResourcePools to return. The service may - * return fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `ListDeploymentResourcePools` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDeploymentResourcePools` 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 [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool} 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 `listDeploymentResourcePoolsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listDeploymentResourcePoolsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDeploymentResourcePools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeploymentResourcePools.createStream( - this.innerApiCalls.listDeploymentResourcePools as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDeploymentResourcePools`, 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 Location which owns this collection of DeploymentResourcePools. - * Format: projects/{project}/locations/{location} - * @param {number} request.pageSize - * The maximum number of DeploymentResourcePools to return. The service may - * return fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `ListDeploymentResourcePools` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDeploymentResourcePools` 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 - * [DeploymentResourcePool]{@link google.cloud.aiplatform.v1beta1.DeploymentResourcePool}. 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_DeploymentResourcePoolService_ListDeploymentResourcePools_async - */ - listDeploymentResourcePoolsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IListDeploymentResourcePoolsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listDeploymentResourcePools']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDeploymentResourcePools.asyncIterate( - this.innerApiCalls['listDeploymentResourcePools'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List DeployedModels that have been deployed on this DeploymentResourcePool. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.deploymentResourcePool - * Required. The name of the target DeploymentResourcePool to query. - * Format: - * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - * @param {number} request.pageSize - * The maximum number of DeployedModels to return. The service may return - * fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `QueryDeployedModels` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `QueryDeployedModels` 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 [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel}. - * 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 `queryDeployedModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDeployedModels( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeployedModel[], - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse - ]>; - queryDeployedModels( - request: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): void; - queryDeployedModels( - request: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - callback: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): void; - queryDeployedModels( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeployedModel>, - callback?: PaginationCallback< - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse|null|undefined, - protos.google.cloud.aiplatform.v1beta1.IDeployedModel>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IDeployedModel[], - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest|null, - protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'deployment_resource_pool': request.deploymentResourcePool ?? '', - }); - this.initialize(); - return this.innerApiCalls.queryDeployedModels(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.deploymentResourcePool - * Required. The name of the target DeploymentResourcePool to query. - * Format: - * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - * @param {number} request.pageSize - * The maximum number of DeployedModels to return. The service may return - * fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `QueryDeployedModels` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `QueryDeployedModels` 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 [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel} 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 `queryDeployedModelsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDeployedModelsStream( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'deployment_resource_pool': request.deploymentResourcePool ?? '', - }); - const defaultCallSettings = this._defaults['queryDeployedModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDeployedModels.createStream( - this.innerApiCalls.queryDeployedModels as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryDeployedModels`, 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.deploymentResourcePool - * Required. The name of the target DeploymentResourcePool to query. - * Format: - * projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} - * @param {number} request.pageSize - * The maximum number of DeployedModels to return. The service may return - * fewer than this value. - * @param {string} request.pageToken - * A page token, received from a previous `QueryDeployedModels` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `QueryDeployedModels` 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 - * [DeployedModel]{@link google.cloud.aiplatform.v1beta1.DeployedModel}. 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_DeploymentResourcePoolService_QueryDeployedModels_async - */ - queryDeployedModelsAsync( - request?: protos.google.cloud.aiplatform.v1beta1.IQueryDeployedModelsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'deployment_resource_pool': request.deploymentResourcePool ?? '', - }); - const defaultCallSettings = this._defaults['queryDeployedModels']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDeployedModels.asyncIterate( - this.innerApiCalls['queryDeployedModels'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.deploymentResourcePoolServiceStub && !this._terminated) { - return this.deploymentResourcePoolServiceStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json deleted file mode 100644 index 060fe052..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService": { - "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": { - "CreateDeploymentResourcePool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDeploymentResourcePool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDeploymentResourcePools": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteDeploymentResourcePool": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryDeployedModels": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json deleted file mode 100644 index 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/deployment_resource_pool_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 f21ab074..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_client.ts +++ /dev/null @@ -1,3681 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new EndpointServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployModel, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployModel, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/endpoint_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 b3f6a1d9..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client.ts +++ /dev/null @@ -1,3032 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FeaturestoreOnlineServingServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - - this.descriptors.longrunning = { - }; - - // 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 = this._gaxModule.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', 'writeFeatureValues']; - 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 this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity_type': request.entityType ?? '', - }); - this.initialize(); - return this.innerApiCalls.readFeatureValues(request, options, callback); - } -/** - * Writes Feature values of one or more entities of an EntityType. - * - * The Feature values are merged into existing entities if any. The Feature - * values to be written must have timestamp within the online storage - * retention. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.entityType - * Required. The resource name of the EntityType for the entities being written. - * Value format: `projects/{project}/locations/{location}/featurestores/ - * {featurestore}/entityTypes/{entityType}`. For example, - * for a machine learning model predicting user clicks on a website, an - * EntityType ID could be `user`. - * @param {number[]} request.payloads - * Required. The entities to be written. Up to 100,000 feature values can be written - * across all `payloads`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteFeatureValuesResponse]{@link google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse}. - * Please see 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_WriteFeatureValues_async - */ - writeFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|undefined, {}|undefined - ]>; - writeFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - writeFeatureValues( - request: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): void; - writeFeatureValues( - request?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse, - protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity_type': request.entityType ?? '', - }); - this.initialize(); - return this.innerApiCalls.writeFeatureValues(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' - ] = this._gaxModule.routingHeader.fromParams({ - 'entity_type': request.entityType ?? '', - }); - this.initialize(); - return this.innerApiCalls.streamingReadFeatureValues(request, options); - } - -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.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 bbe56dc0..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_client_config.json +++ /dev/null @@ -1,40 +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" - }, - "WriteFeatureValues": { - "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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_online_serving_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 65342472..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_client.ts +++ /dev/null @@ -1,5858 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new FeaturestoreServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeaturestore, this._gaxModule.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` - * * `online_serving_config.scaling` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFeaturestore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeaturestore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createEntityType, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteEntityType, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFeature, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchCreateFeatures, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFeature, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.importFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchReadFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportFeatureValues, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/featurestore_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 e3e19f14..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,2369 +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" - ] - }, - "ListSavedQueries": { - "methods": [ - "listSavedQueries", - "listSavedQueriesStream", - "listSavedQueriesAsync" - ] - }, - "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" - ] - }, - "ListSavedQueries": { - "methods": [ - "listSavedQueries", - "listSavedQueriesStream", - "listSavedQueriesAsync" - ] - }, - "ListAnnotations": { - "methods": [ - "listAnnotations", - "listAnnotationsStream", - "listAnnotationsAsync" - ] - } - } - } - } - }, - "DeploymentResourcePoolService": { - "clients": { - "grpc": { - "libraryClient": "DeploymentResourcePoolServiceClient", - "rpcs": { - "GetDeploymentResourcePool": { - "methods": [ - "getDeploymentResourcePool" - ] - }, - "CreateDeploymentResourcePool": { - "methods": [ - "createDeploymentResourcePool" - ] - }, - "DeleteDeploymentResourcePool": { - "methods": [ - "deleteDeploymentResourcePool" - ] - }, - "ListDeploymentResourcePools": { - "methods": [ - "listDeploymentResourcePools", - "listDeploymentResourcePoolsStream", - "listDeploymentResourcePoolsAsync" - ] - }, - "QueryDeployedModels": { - "methods": [ - "queryDeployedModels", - "queryDeployedModelsStream", - "queryDeployedModelsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DeploymentResourcePoolServiceClient", - "rpcs": { - "GetDeploymentResourcePool": { - "methods": [ - "getDeploymentResourcePool" - ] - }, - "CreateDeploymentResourcePool": { - "methods": [ - "createDeploymentResourcePool" - ] - }, - "DeleteDeploymentResourcePool": { - "methods": [ - "deleteDeploymentResourcePool" - ] - }, - "ListDeploymentResourcePools": { - "methods": [ - "listDeploymentResourcePools", - "listDeploymentResourcePoolsStream", - "listDeploymentResourcePoolsAsync" - ] - }, - "QueryDeployedModels": { - "methods": [ - "queryDeployedModels", - "queryDeployedModelsStream", - "queryDeployedModelsAsync" - ] - } - } - } - } - }, - "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" - ] - }, - "WriteFeatureValues": { - "methods": [ - "writeFeatureValues" - ] - }, - "StreamingReadFeatureValues": { - "methods": [ - "streamingReadFeatureValues" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "FeaturestoreOnlineServingServiceClient", - "rpcs": { - "ReadFeatureValues": { - "methods": [ - "readFeatureValues" - ] - }, - "WriteFeatureValues": { - "methods": [ - "writeFeatureValues" - ] - } - } - } - } - }, - "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" - ] - }, - "UpsertDatapoints": { - "methods": [ - "upsertDatapoints" - ] - }, - "RemoveDatapoints": { - "methods": [ - "removeDatapoints" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "UpdateIndex": { - "methods": [ - "updateIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "IndexServiceClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "UpsertDatapoints": { - "methods": [ - "upsertDatapoints" - ] - }, - "RemoveDatapoints": { - "methods": [ - "removeDatapoints" - ] - }, - "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" - ] - }, - "BatchImportModelEvaluationSlices": { - "methods": [ - "batchImportModelEvaluationSlices" - ] - }, - "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" - ] - }, - "BatchImportModelEvaluationSlices": { - "methods": [ - "batchImportModelEvaluationSlices" - ] - }, - "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 838f2630..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,34 +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 {DeploymentResourcePoolServiceClient} from './deployment_resource_pool_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 8644a241..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_client.ts +++ /dev/null @@ -1,3765 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new IndexEndpointServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndexEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndexEndpoint, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deployIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.undeployIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.mutateDeployedIndex, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_endpoint_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 304bcd51..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client.ts +++ /dev/null @@ -1,3581 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new IndexServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'upsertDatapoints', 'removeDatapoints']; - 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._opts.fallback - ); - - 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' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIndex(request, options, callback); - } -/** - * Add/update Datapoints into an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.index - * Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {number[]} request.datapoints - * A list of datapoints to be created/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 [UpsertDatapointsResponse]{@link google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse}. - * Please see 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_UpsertDatapoints_async - */ - upsertDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|undefined, {}|undefined - ]>; - upsertDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): void; - upsertDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): void; - upsertDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'index': request.index ?? '', - }); - this.initialize(); - return this.innerApiCalls.upsertDatapoints(request, options, callback); - } -/** - * Remove Datapoints from an Index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.index - * Required. The name of the Index resource to be updated. - * Format: - * `projects/{project}/locations/{location}/indexes/{index}` - * @param {string[]} request.datapointIds - * A list of datapoint ids to 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 [RemoveDatapointsResponse]{@link google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse}. - * Please see 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_RemoveDatapoints_async - */ - removeDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|undefined, {}|undefined - ]>; - removeDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): void; - removeDatapoints( - request: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): void; - removeDatapoints( - request?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse, - protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'index': request.index ?? '', - }); - this.initialize(); - return this.innerApiCalls.removeDatapoints(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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateIndex, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteIndex, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 18cb2461..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_client_config.json +++ /dev/null @@ -1,59 +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" - }, - "UpsertDatapoints": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveDatapoints": { - "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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 dd4c8d0e..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/job_service_client.ts +++ /dev/null @@ -1,6139 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new JobServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteCustomJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteDataLabelingJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteHyperparameterTuningJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBatchPredictionJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateModelDeploymentMonitoringJob, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelDeploymentMonitoringJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `model_display_name` supports `=`, `!=` comparisons. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 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. - * - * Supported fields: - * - * * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` - * * `state!="JOB_STATE_FAILED" OR display_name="my_job"` - * * `NOT display_name="my_job"` - * * `create_time>"2021-05-18T00:00:00Z"` - * @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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/job_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 74329eb0..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_client.ts +++ /dev/null @@ -1,6464 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MetadataServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMetadataStore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMetadataStore, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteArtifact, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeArtifacts, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteContext, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeContexts, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteExecution, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.purgeExecutions, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/metadata_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 14f62ebc..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_client.ts +++ /dev/null @@ -1,3189 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new MigrationServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.batchMigrateResources, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/migration_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 58e52548..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client.ts +++ /dev/null @@ -1,4812 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new ModelServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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', 'batchImportModelEvaluationSlices', '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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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-zA-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' - ] = this._gaxModule.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.importModelEvaluation(request, options, callback); - } -/** - * Imports a list of externally generated ModelEvaluationSlice. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the parent ModelEvaluation resource. - * Format: - * `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}` - * @param {number[]} request.modelEvaluationSlices - * Required. Model evaluation slice 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 [BatchImportModelEvaluationSlicesResponse]{@link google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse}. - * Please see 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_BatchImportModelEvaluationSlices_async - */ - batchImportModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined - ]>; - batchImportModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): void; - batchImportModelEvaluationSlices( - request: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, - callback: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): void; - batchImportModelEvaluationSlices( - request?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse, - protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize(); - return this.innerApiCalls.batchImportModelEvaluationSlices(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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.uploadModel, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Incrementally update the dataset used for an 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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateExplanationDataset, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModel, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteModelVersion, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportModel, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 e467c45b..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_client_config.json +++ /dev/null @@ -1,100 +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" - }, - "BatchImportModelEvaluationSlices": { - "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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/model_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 8c0d6da1..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_client.ts +++ /dev/null @@ -1,4103 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PipelineServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTrainingPipeline, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deletePipelineJob, this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 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 `=`, `!=` comparisons, and `:` wildcard. - * * `state` supports `=`, `!=` comparisons. - * * `training_task_definition` `=`, `!=` comparisons, and `:` wildcard. - * * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=` comparisons. - * `create_time` must be in RFC 3339 format. - * - * Some examples of using the filter are: - * - * * `state="PIPELINE_STATE_SUCCEEDED" AND display_name:"my_pipeline_*"` - * * `state!="PIPELINE_STATE_FAILED" OR display_name="my_pipeline"` - * * `NOT display_name="my_pipeline"` - * * `create_time>"2021-05-18T00:00:00Z"` - * * `training_task_definition:"*automl_text_classification*"` - * @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' - ] = this._gaxModule.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 {}, - 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`: 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' - ] = this._gaxModule.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`: 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' - ] = this._gaxModule.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 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`: 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/pipeline_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 c3c466e6..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_client.ts +++ /dev/null @@ -1,3097 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, IamClient, IamProtos, LocationsClient, LocationProtos} 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new PredictionServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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}' - ), - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - - this.descriptors.longrunning = { - }; - - // 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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.routingHeader.fromParams({ - 'endpoint': request.endpoint ?? '', - }); - this.initialize(); - return this.innerApiCalls.explain(request, options, callback); - } - -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/prediction_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 79c3d47d..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_client.ts +++ /dev/null @@ -1,3430 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new SpecialistPoolServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSpecialistPool, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/specialist_pool_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 7fd77dbf..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_client.ts +++ /dev/null @@ -1,5933 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform, 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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new TensorboardServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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(this._gaxModule.StreamType.SERVER_STREAMING, opts.fallback === 'rest') - }; - - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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 this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboard, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardExperiment, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardRun, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTensorboardTimeSeries, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/tensorboard_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 677e44d4..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_client.ts +++ /dev/null @@ -1,4260 +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 type * as gax from 'google-gax'; -import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -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'; -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}; - iamClient: IamClient; - locationsClient: LocationsClient; - 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/main/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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new VizierServiceClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // 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; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // 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}' - ), - deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' - ), - 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}' - ), - savedQueryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' - ), - 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. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }; - if (opts.fallback === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/ui/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1beta1/{name=projects/*/locations/*}',}], - },{selector: 'google.cloud.location.Locations.ListLocations',get: '/ui/{name=projects/*}/locations',additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy',body: '*',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions',},{post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:cancel',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{delete: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/ui/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/ui/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/ui/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*}/operations',},{get: '/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*}/operations',},{get: '/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations',},{get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations',}], - },{selector: 'google.longrunning.Operations.WaitOperation',post: '/ui/{name=projects/*/locations/*/operations/*}:wait',additional_bindings: [{post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait',},{post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).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 = this._gaxModule.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._opts.fallback - ); - - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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. It must be positive. - * @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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.suggestTrials, this._gaxModule.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' - ] = this._gaxModule.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 this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.checkTrialEarlyStoppingState, this._gaxModule.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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - 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' - ] = this._gaxModule.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' - ] = this._gaxModule.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 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' - ] = this._gaxModule.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 {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the 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 [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. 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 - * The resource that owns the locations collection, if applicable. - * @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 {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 - * [Location]{@link google.cloud.location.Location}. 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 - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. The promise has a method named - * "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(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 deploymentResourcePool resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} deployment_resource_pool - * @returns {string} Resource name string. - */ - deploymentResourcePoolPath(project:string,location:string,deploymentResourcePool:string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ - project: project, - location: location, - deployment_resource_pool: deploymentResourcePool, - }); - } - - /** - * Parse the project from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).project; - } - - /** - * Parse the location from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).location; - } - - /** - * Parse the deployment_resource_pool from DeploymentResourcePool resource. - * - * @param {string} deploymentResourcePoolName - * A fully-qualified path representing DeploymentResourcePool resource. - * @returns {string} A string representing the deployment_resource_pool. - */ - matchDeploymentResourcePoolFromDeploymentResourcePoolName(deploymentResourcePoolName: string) { - return this.pathTemplates.deploymentResourcePoolPathTemplate.match(deploymentResourcePoolName).deployment_resource_pool; - } - - /** - * 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 savedQuery resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} dataset - * @param {string} saved_query - * @returns {string} Resource name string. - */ - savedQueryPath(project:string,location:string,dataset:string,savedQuery:string) { - return this.pathTemplates.savedQueryPathTemplate.render({ - project: project, - location: location, - dataset: dataset, - saved_query: savedQuery, - }); - } - - /** - * Parse the project from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).project; - } - - /** - * Parse the location from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).location; - } - - /** - * Parse the dataset from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the dataset. - */ - matchDatasetFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).dataset; - } - - /** - * Parse the saved_query from SavedQuery resource. - * - * @param {string} savedQueryName - * A fully-qualified path representing SavedQuery resource. - * @returns {string} A string representing the saved_query. - */ - matchSavedQueryFromSavedQueryName(savedQueryName: string) { - return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName).saved_query; - } - - /** - * 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.iamClient.close(); - this.locationsClient.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 574e74be..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/vizier_service_proto_list.json +++ /dev/null @@ -1,121 +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/deployment_resource_pool.proto", - "../../protos/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.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_failure_policy.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/saved_query.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 84abc66e..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js +++ /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 -// -// 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 deploymentResourcePoolServiceClient = new aiplatform.DeploymentResourcePoolServiceClient(); - 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 764393ae..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,122 +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, DeploymentResourcePoolServiceClient, 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 doStuffWithDeploymentResourcePoolServiceClient(client: DeploymentResourcePoolServiceClient) { - 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 deploymentResourcePoolServiceClient = new DeploymentResourcePoolServiceClient(); - doStuffWithDeploymentResourcePoolServiceClient(deploymentResourcePoolServiceClient); - // 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 557a5755..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 af021883..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_dataset_service_v1beta1.ts +++ /dev/null @@ -1,4615 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDatasetRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataset = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateDatasetRequest', ['dataset', 'name']); - request.dataset.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAnnotationSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAnnotationSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetAnnotationSpecRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDatasetRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDatasetRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importData(request), expectedError); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importData(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportData(request), expectedError); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportDataRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportData = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportData(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDatasets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDatasets(request), expectedError); - const actualRequest = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDatasetsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDatasets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataItems = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataItems(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataItemsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataItems.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSavedQueries', () => { - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - ]; - client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); - const [response] = await client.listSavedQueries(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - ]; - client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSavedQueries( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSavedQueries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSavedQueries(request), expectedError); - const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - ]; - client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSavedQueriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.SavedQuery[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SavedQuery) => { - 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.listSavedQueries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); - assert( - (client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSavedQueriesStream 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSavedQueriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.SavedQuery[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.SavedQuery) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); - assert( - (client.descriptors.page.listSavedQueries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.SavedQuery()), - ]; - client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[] = []; - const iterable = client.listSavedQueriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSavedQueries 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.ListSavedQueriesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListSavedQueriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSavedQueriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.ISavedQuery[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAnnotations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAnnotations(request), expectedError); - const actualRequest = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListAnnotationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new datasetserviceModule.v1beta1.DatasetServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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_deployment_resource_pool_service_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts deleted file mode 100644 index c9a64529..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ /dev/null @@ -1,3627 +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 deploymentresourcepoolserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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.DeploymentResourcePoolServiceClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.deploymentResourcePoolServiceStub, undefined); - await client.initialize(); - assert(client.deploymentResourcePoolServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.deploymentResourcePoolServiceStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.deploymentResourcePoolServiceStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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('getDeploymentResourcePool', () => { - it('invokes getDeploymentResourcePool without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() - ); - client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall(expectedResponse); - const [response] = await client.getDeploymentResourcePool(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeploymentResourcePool without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() - ); - client.innerApiCalls.getDeploymentResourcePool = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDeploymentResourcePool( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeploymentResourcePool with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDeploymentResourcePool(request), expectedError); - const actualRequest = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDeploymentResourcePool with closed client', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('GetDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getDeploymentResourcePool(request), expectedError); - }); - }); - - describe('createDeploymentResourcePool', () => { - it('invokes createDeploymentResourcePool without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(expectedResponse); - const [operation] = await client.createDeploymentResourcePool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeploymentResourcePool without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createDeploymentResourcePool( - 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); - const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeploymentResourcePool with call error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createDeploymentResourcePool(request), expectedError); - const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createDeploymentResourcePool with LRO error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDeploymentResourcePoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createDeploymentResourcePool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateDeploymentResourcePoolProgress without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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.checkCreateDeploymentResourcePoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateDeploymentResourcePoolProgress with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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.checkCreateDeploymentResourcePoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteDeploymentResourcePool', () => { - it('invokes deleteDeploymentResourcePool without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDeploymentResourcePool(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeploymentResourcePool without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteDeploymentResourcePool( - 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); - const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeploymentResourcePool with call error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDeploymentResourcePool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteDeploymentResourcePool with LRO error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDeploymentResourcePoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDeploymentResourcePool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteDeploymentResourcePoolProgress without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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.checkDeleteDeploymentResourcePoolProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteDeploymentResourcePoolProgress with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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.checkDeleteDeploymentResourcePoolProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listDeploymentResourcePools', () => { - it('invokes listDeploymentResourcePools without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - ]; - client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall(expectedResponse); - const [response] = await client.listDeploymentResourcePools(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentResourcePools without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - ]; - client.innerApiCalls.listDeploymentResourcePools = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDeploymentResourcePools( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentResourcePools with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDeploymentResourcePools(request), expectedError); - const actualRequest = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDeploymentResourcePoolsStream without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - ]; - client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDeploymentResourcePoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool) => { - 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.listDeploymentResourcePools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeploymentResourcePools, request)); - assert( - (client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDeploymentResourcePoolsStream with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDeploymentResourcePoolsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDeploymentResourcePools, request)); - assert( - (client.descriptors.page.listDeploymentResourcePools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeploymentResourcePools without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool()), - ]; - client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[] = []; - const iterable = client.listDeploymentResourcePoolsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDeploymentResourcePools with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('ListDeploymentResourcePoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDeploymentResourcePoolsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDeploymentResourcePool[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDeploymentResourcePools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('queryDeployedModels', () => { - it('invokes queryDeployedModels without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - ]; - client.innerApiCalls.queryDeployedModels = stubSimpleCall(expectedResponse); - const [response] = await client.queryDeployedModels(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes queryDeployedModels without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - ]; - client.innerApiCalls.queryDeployedModels = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryDeployedModels( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes queryDeployedModels with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryDeployedModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryDeployedModels(request), expectedError); - const actualRequest = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes queryDeployedModelsStream without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - ]; - client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryDeployedModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DeployedModel[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeployedModel) => { - 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.queryDeployedModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDeployedModels, request)); - assert( - (client.descriptors.page.queryDeployedModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes queryDeployedModelsStream with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryDeployedModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.DeployedModel[] = []; - stream.on('data', (response: protos.google.cloud.aiplatform.v1beta1.DeployedModel) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryDeployedModels.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDeployedModels, request)); - assert( - (client.descriptors.page.queryDeployedModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with queryDeployedModels without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - generateSampleMessage(new protos.google.cloud.aiplatform.v1beta1.DeployedModel()), - ]; - client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[] = []; - const iterable = client.queryDeployedModelsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with queryDeployedModels with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('QueryDeployedModelsRequest', ['deploymentResourcePool']); - request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryDeployedModelsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IDeployedModel[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 deploymentresourcepoolserviceModule.v1beta1.DeploymentResourcePoolServiceClient({ - 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 22e4aea9..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,3772 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEndpointRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEndpointRequest', ['endpoint', 'name']); - request.endpoint.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployModel(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployModelRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEndpoints(request), expectedError); - const actualRequest = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new endpointserviceModule.v1beta1.EndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 adef8d9f..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ /dev/null @@ -1,2937 +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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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 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.FeaturestoreOnlineServingServiceClient', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readFeatureValues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readFeatureValues(request), expectedError); - }); - }); - - describe('writeFeatureValues', () => { - it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() - ); - client.innerApiCalls.writeFeatureValues = stubSimpleCall(expectedResponse); - const [response] = await client.writeFeatureValues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() - ); - client.innerApiCalls.writeFeatureValues = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeFeatureValues( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IWriteFeatureValuesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.writeFeatureValues = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes writeFeatureValues 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.WriteFeatureValuesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('WriteFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeFeatureValues(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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StreamingReadFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - 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('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new featurestoreonlineservingserviceModule.v1beta1.FeaturestoreOnlineServingServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 e9c06ed0..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_featurestore_service_v1beta1.ts +++ /dev/null @@ -1,5947 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeaturestore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeaturestoreRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetEntityTypeRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateEntityType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateEntityTypeRequest', ['entityType', 'name']); - request.entityType.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetFeatureRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeature = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeatureRequest', ['feature', 'name']); - request.feature.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeaturestoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateFeaturestoreRequest', ['featurestore', 'name']); - request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeaturestore(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeaturestoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeaturestore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeaturestore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateEntityTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createEntityType(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteEntityType(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteEntityTypeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteEntityType = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteEntityType(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateFeatureRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createFeature(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchCreateFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateFeatures = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchCreateFeatures(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteFeature(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteFeatureRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteFeature = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteFeature(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.importFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.importFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchReadFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadFeatureValuesRequest', ['featurestore']); - request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchReadFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportFeatureValues(request), expectedError); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportFeatureValuesRequest', ['entityType']); - request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportFeatureValues = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportFeatureValues(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeaturestores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeaturestores(request), expectedError); - const actualRequest = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturestoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listEntityTypes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listEntityTypes(request), expectedError); - const actualRequest = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListEntityTypesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListFeaturesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchFeatures = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchFeatures(request), expectedError); - const actualRequest = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchFeaturesRequest', ['location']); - request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; - 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( - (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new featurestoreserviceModule.v1beta1.FeaturestoreServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 799d096b..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_index_endpoint_service_v1beta1.ts +++ /dev/null @@ -1,3926 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexEndpointRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndexEndpoint = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexEndpointRequest', ['indexEndpoint', 'name']); - request.indexEndpoint.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexEndpointRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndexEndpoint(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexEndpointRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndexEndpoint(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deployIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deployIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeployIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UndeployIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeployIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeployIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.mutateDeployedIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MutateDeployedIndexRequest', ['indexEndpoint']); - request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.mutateDeployedIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexEndpoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexEndpoints(request), expectedError); - const actualRequest = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexEndpointsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new indexendpointserviceModule.v1beta1.IndexEndpointServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 ba38c283..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_index_service_v1beta1.ts +++ /dev/null @@ -1,3726 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetIndexRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIndex(request), expectedError); - }); - }); - - describe('upsertDatapoints', () => { - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() - ); - client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); - const [response] = await client.upsertDatapoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() - ); - client.innerApiCalls.upsertDatapoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upsertDatapoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IUpsertDatapointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.upsertDatapoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.upsertDatapoints(request), expectedError); - const actualRequest = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes upsertDatapoints 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.UpsertDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('UpsertDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.upsertDatapoints(request), expectedError); - }); - }); - - describe('removeDatapoints', () => { - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() - ); - client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); - const [response] = await client.removeDatapoints(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() - ); - client.innerApiCalls.removeDatapoints = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDatapoints( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IRemoveDatapointsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDatapoints = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDatapoints(request), expectedError); - const actualRequest = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes removeDatapoints 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.RemoveDatapointsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('RemoveDatapointsRequest', ['index']); - request.index = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeDatapoints(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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateIndexRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateIndexRequest', ['index', 'name']); - request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteIndex(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteIndexRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexes = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listIndexes(request), expectedError); - const actualRequest = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListIndexesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new indexserviceModule.v1beta1.IndexServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 e06dc505..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_job_service_v1beta1.ts +++ /dev/null @@ -1,6817 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateCustomJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetCustomJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelCustomJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelCustomJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelCustomJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateDataLabelingJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelDataLabelingJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateHyperparameterTuningJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelHyperparameterTuningJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateBatchPredictionJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelBatchPredictionJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateModelDeploymentMonitoringJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.pauseModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pauseModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PauseModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(expectedResponse); - const [response] = await client.resumeModelDeploymentMonitoringJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resumeModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ResumeModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCustomJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteCustomJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCustomJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCustomJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteDataLabelingJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteDataLabelingJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteDataLabelingJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteHyperparameterTuningJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteHyperparameterTuningJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteHyperparameterTuningJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBatchPredictionJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteBatchPredictionJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBatchPredictionJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelDeploymentMonitoringJobRequest', ['modelDeploymentMonitoringJob', 'name']); - request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelDeploymentMonitoringJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelDeploymentMonitoringJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelDeploymentMonitoringJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listCustomJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCustomJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListCustomJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataLabelingJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataLabelingJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListDataLabelingJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHyperparameterTuningJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListHyperparameterTuningJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listHyperparameterTuningJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBatchPredictionJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListBatchPredictionJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listBatchPredictionJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError); - const actualRequest = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchModelDeploymentMonitoringStatsAnomaliesRequest', ['modelDeploymentMonitoringJob']); - request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; - 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( - (client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelDeploymentMonitoringJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelDeploymentMonitoringJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new jobserviceModule.v1beta1.JobServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 65f345da..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_metadata_service_v1beta1.ts +++ /dev/null @@ -1,7134 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataStore = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataStoreRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetArtifactRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createContext(request), expectedError); - const actualRequest = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateContextRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getContext(request), expectedError); - const actualRequest = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetContextRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateContext = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateContext(request), expectedError); - const actualRequest = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateContextRequest', ['context', 'name']); - request.context.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextArtifactsAndExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextArtifactsAndExecutionsRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addContextChildren = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addContextChildren(request), expectedError); - const actualRequest = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddContextChildrenRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryContextLineageSubgraph(request), expectedError); - const actualRequest = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryContextLineageSubgraphRequest', ['context']); - request.context = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateExecutionRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetExecutionRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExecution = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateExecutionRequest', ['execution', 'name']); - request.execution.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addExecutionEvents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addExecutionEvents(request), expectedError); - const actualRequest = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddExecutionEventsRequest', ['execution']); - request.execution = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryExecutionInputsAndOutputs(request), expectedError); - const actualRequest = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryExecutionInputsAndOutputsRequest', ['execution']); - request.execution = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createMetadataSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataSchemaRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getMetadataSchema = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getMetadataSchema(request), expectedError); - const actualRequest = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetMetadataSchemaRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryArtifactLineageSubgraph(request), expectedError); - const actualRequest = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('QueryArtifactLineageSubgraphRequest', ['artifact']); - request.artifact = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateMetadataStoreRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteMetadataStore(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteMetadataStoreRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteMetadataStore = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteMetadataStore(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteArtifact(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeArtifacts(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeArtifacts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeArtifacts(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteContext(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteContextRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteContext = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteContext(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeContexts(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeContexts = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeContexts(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteExecution(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteExecutionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteExecution = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteExecution(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.purgeExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PurgeExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeExecutions = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.purgeExecutions(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataStores = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataStores(request), expectedError); - const actualRequest = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataStoresRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listArtifacts(request), expectedError); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listContexts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listContexts(request), expectedError); - const actualRequest = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listContexts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListContextsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listContexts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listExecutions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listExecutions(request), expectedError); - const actualRequest = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListExecutionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listExecutions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listMetadataSchemas = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listMetadataSchemas(request), expectedError); - const actualRequest = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListMetadataSchemasRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new metadataserviceModule.v1beta1.MetadataServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 520a65b5..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_migration_service_v1beta1.ts +++ /dev/null @@ -1,3090 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.batchMigrateResources(request), expectedError); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchMigrateResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchMigrateResources = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.batchMigrateResources(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.searchMigratableResources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.searchMigratableResources(request), expectedError); - const actualRequest = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SearchMigratableResourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.searchMigratableResources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new migrationserviceModule.v1beta1.MigrationServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 1f4a1a43..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_model_service_v1beta1.ts +++ /dev/null @@ -1,5201 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModel(request), expectedError); - const actualRequest = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateModel = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateModel(request), expectedError); - const actualRequest = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateModelRequest', ['model', 'name']); - request.model.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.mergeVersionAliases = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.mergeVersionAliases(request), expectedError); - const actualRequest = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('MergeVersionAliasesRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.importModelEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ImportModelEvaluationRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.importModelEvaluation(request), expectedError); - }); - }); - - describe('batchImportModelEvaluationSlices', () => { - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() - ); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(expectedResponse); - const [response] = await client.batchImportModelEvaluationSlices(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() - ); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.batchImportModelEvaluationSlices( - request, - (err?: Error|null, result?: protos.google.cloud.aiplatform.v1beta1.IBatchImportModelEvaluationSlicesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchImportModelEvaluationSlices(request), expectedError); - const actualRequest = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes batchImportModelEvaluationSlices 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.BatchImportModelEvaluationSlicesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('BatchImportModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.batchImportModelEvaluationSlices(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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluation(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getModelEvaluationSlice(request), expectedError); - const actualRequest = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetModelEvaluationSliceRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.uploadModel(request), expectedError); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UploadModelRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.uploadModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.uploadModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); - request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); - request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); - request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateExplanationDataset(request), expectedError); - const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('UpdateExplanationDatasetRequest', ['model']); - request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateExplanationDataset = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateExplanationDataset(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModel(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteModelVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteModelVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteModelVersion = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteModelVersion(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.exportModel(request), expectedError); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportModelRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportModel = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.exportModel(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportModel as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModels = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModels(request), expectedError); - const actualRequest = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModels as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModels.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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( - (client.descriptors.page.listModelVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelVersionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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( - (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluations(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listModelEvaluationSlices(request), expectedError); - const actualRequest = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListModelEvaluationSlicesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listModelEvaluationSlices.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new modelserviceModule.v1beta1.ModelServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 ae08169f..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_pipeline_service_v1beta1.ts +++ /dev/null @@ -1,4137 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrainingPipelineRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(expectedResponse); - const [response] = await client.cancelTrainingPipeline(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreatePipelineJobRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetPipelineJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelPipelineJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelPipelineJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelPipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CancelPipelineJobRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTrainingPipeline(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrainingPipelineRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTrainingPipeline(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deletePipelineJob(request), expectedError); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeletePipelineJobRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deletePipelineJob = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deletePipelineJob(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrainingPipelines = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrainingPipelines(request), expectedError); - const actualRequest = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrainingPipelinesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrainingPipelines.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listPipelineJobs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listPipelineJobs(request), expectedError); - const actualRequest = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListPipelineJobsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new pipelineserviceModule.v1beta1.PipelineServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 83384f6d..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_prediction_service_v1beta1.ts +++ /dev/null @@ -1,2934 +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, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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 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.PredictionServiceClient', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.predict(request), expectedError); - const actualRequest = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.predict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('PredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.rawPredict = stubSimpleCall(expectedResponse); - const [response] = await client.rawPredict(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rawPredict = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rawPredict(request), expectedError); - const actualRequest = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('RawPredictRequest', ['endpoint']); - request.endpoint = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.explain(request), expectedError); - const actualRequest = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.explain as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExplainRequest', ['endpoint']); - request.endpoint = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.explain(request), expectedError); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new predictionserviceModule.v1beta1.PredictionServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 c9cbcef1..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_specialist_pool_service_v1beta1.ts +++ /dev/null @@ -1,3510 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSpecialistPool = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateSpecialistPoolRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteSpecialistPoolRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateSpecialistPool(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateSpecialistPoolRequest', ['specialistPool', 'name']); - request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSpecialistPool = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateSpecialistPool(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSpecialistPools = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSpecialistPools(request), expectedError); - const actualRequest = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListSpecialistPoolsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new specialistpoolserviceModule.v1beta1.SpecialistPoolServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 a146d7f1..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_tensorboard_service_v1beta1.ts +++ /dev/null @@ -1,6723 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboard = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardExperimentRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardExperimentRequest', ['tensorboardExperiment', 'name']); - request.tensorboardExperiment.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRunRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardRuns(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardRunRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardRun = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRunRequest', ['tensorboardRun', 'name']); - request.tensorboardRun.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchCreateTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchCreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardTimeSeriesRequest', ['tensorboardTimeSeries', 'name']); - request.tensorboardTimeSeries.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.batchReadTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('BatchReadTensorboardTimeSeriesDataRequest', ['tensorboard']); - request.tensorboard = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardExperimentData(request), expectedError); - const actualRequest = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardExperimentDataRequest', ['tensorboardExperiment']); - request.tensorboardExperiment = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.writeTensorboardRunData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeTensorboardRunData(request), expectedError); - const actualRequest = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('WriteTensorboardRunDataRequest', ['tensorboardRun']); - request.tensorboardRun = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTensorboardRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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 ??= {}; - const defaultValue1 = - getTypeDefaultValue('UpdateTensorboardRequest', ['tensorboard', 'name']); - request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboard(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboard = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboard(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardExperiment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardExperimentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardExperiment(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardRun(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardRunRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardRun(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTensorboardTimeSeriesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteTensorboardTimeSeries(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ReadTensorboardBlobDataRequest', ['timeSeries']); - request.timeSeries = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboards = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboards(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardExperiments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardExperiments(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardExperimentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardExperiments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardRuns = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardRuns(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardRunsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTensorboardTimeSeries(request), expectedError); - const actualRequest = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTensorboardTimeSeriesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTensorboardTimeSeries.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.exportTensorboardTimeSeriesData(request), expectedError); - const actualRequest = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ExportTensorboardTimeSeriesDataRequest', ['tensorboardTimeSeries']); - request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; - 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( - (client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new tensorboardserviceModule.v1beta1.TensorboardServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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 a13e1af5..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_vizier_service_v1beta1.ts +++ /dev/null @@ -1,4677 +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, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -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', () => { - describe('Common methods', () => { - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateStudyRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetStudyRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteStudy = stubSimpleCall(expectedResponse); - const [response] = await client.deleteStudy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteStudyRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.lookupStudy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookupStudy(request), expectedError); - const actualRequest = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('LookupStudyRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CreateTrialRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('GetTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.addTrialMeasurement = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addTrialMeasurement(request), expectedError); - const actualRequest = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('AddTrialMeasurementRequest', ['trialName']); - request.trialName = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.completeTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.completeTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CompleteTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTrial = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTrial(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('DeleteTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.stopTrial(request), expectedError); - const actualRequest = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('StopTrialRequest', ['name']); - request.name = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listOptimalTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listOptimalTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListOptimalTrialsRequest', ['parent']); - request.parent = defaultValue1; - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.suggestTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('SuggestTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.suggestTrials = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.suggestTrials(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - 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); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.checkTrialEarlyStoppingState(request), expectedError); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('CheckTrialEarlyStoppingStateRequest', ['trialName']); - request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.checkTrialEarlyStoppingState(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listStudies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listStudies(request), expectedError); - const actualRequest = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listStudies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListStudiesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listStudies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;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); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTrials = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTrials(request), expectedError); - const actualRequest = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTrials as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - 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() - ); - const defaultValue1 = - getTypeDefaultValue('ListTrialsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - 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( - (client.descriptors.page.listTrials.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy 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 IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy 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 IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions 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 IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation 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 LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - 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('deploymentResourcePool', () => { - const fakePath = "/rendered/path/deploymentResourcePool"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - deployment_resource_pool: "deploymentResourcePoolValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.deploymentResourcePoolPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.deploymentResourcePoolPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('deploymentResourcePoolPath', () => { - const result = client.deploymentResourcePoolPath("projectValue", "locationValue", "deploymentResourcePoolValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDeploymentResourcePoolName', () => { - const result = client.matchProjectFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDeploymentResourcePoolName', () => { - const result = client.matchLocationFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { - const result = client.matchDeploymentResourcePoolFromDeploymentResourcePoolName(fakePath); - assert.strictEqual(result, "deploymentResourcePoolValue"); - assert((client.pathTemplates.deploymentResourcePoolPathTemplate.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('savedQuery', () => { - const fakePath = "/rendered/path/savedQuery"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - dataset: "datasetValue", - saved_query: "savedQueryValue", - }; - const client = new vizierserviceModule.v1beta1.VizierServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.savedQueryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.savedQueryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('savedQueryPath', () => { - const result = client.savedQueryPath("projectValue", "locationValue", "datasetValue", "savedQueryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.savedQueryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSavedQueryName', () => { - const result = client.matchProjectFromSavedQueryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSavedQueryName', () => { - const result = client.matchLocationFromSavedQueryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasetFromSavedQueryName', () => { - const result = client.matchDatasetFromSavedQueryName(fakePath); - assert.strictEqual(result, "datasetValue"); - assert((client.pathTemplates.savedQueryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSavedQueryFromSavedQueryName', () => { - const result = client.matchSavedQueryFromSavedQueryName(fakePath); - assert.strictEqual(result, "savedQueryValue"); - assert((client.pathTemplates.savedQueryPathTemplate.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/src/v1/dataset_service_client.ts b/src/v1/dataset_service_client.ts index 81407020..35f9703b 100644 --- a/src/v1/dataset_service_client.ts +++ b/src/v1/dataset_service_client.ts @@ -1552,7 +1552,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getDataset(request, options, callback); @@ -1651,7 +1651,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'dataset.name': request.dataset!.name || '', + 'dataset.name': request.dataset!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateDataset(request, options, callback); @@ -1746,7 +1746,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getAnnotationSpec(request, options, callback); @@ -1853,7 +1853,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createDataset(request, options, callback); @@ -1993,7 +1993,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteDataset(request, options, callback); @@ -2136,7 +2136,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.importData(request, options, callback); @@ -2278,7 +2278,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.exportData(request, options, callback); @@ -2437,7 +2437,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDatasets(request, options, callback); @@ -2501,7 +2501,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); @@ -2574,7 +2574,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); @@ -2687,7 +2687,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDataItems(request, options, callback); @@ -2734,7 +2734,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataItems']; const callSettings = defaultCallSettings.merge(options); @@ -2790,7 +2790,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataItems']; const callSettings = defaultCallSettings.merge(options); @@ -2903,7 +2903,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSavedQueries(request, options, callback); @@ -2950,7 +2950,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); @@ -3006,7 +3006,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); @@ -3119,7 +3119,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAnnotations(request, options, callback); @@ -3166,7 +3166,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAnnotations']; const callSettings = defaultCallSettings.merge(options); @@ -3222,7 +3222,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAnnotations']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/endpoint_service_client.ts b/src/v1/endpoint_service_client.ts index 49ef16d1..29f22efe 100644 --- a/src/v1/endpoint_service_client.ts +++ b/src/v1/endpoint_service_client.ts @@ -1532,7 +1532,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getEndpoint(request, options, callback); @@ -1625,7 +1625,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'endpoint.name': request.endpoint!.name || '', + 'endpoint.name': request.endpoint!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateEndpoint(request, options, callback); @@ -1741,7 +1741,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createEndpoint(request, options, callback); @@ -1881,7 +1881,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteEndpoint(request, options, callback); @@ -2038,7 +2038,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.deployModel(request, options, callback); @@ -2189,7 +2189,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.undeployModel(request, options, callback); @@ -2353,7 +2353,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listEndpoints(request, options, callback); @@ -2422,7 +2422,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEndpoints']; const callSettings = defaultCallSettings.merge(options); @@ -2500,7 +2500,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEndpoints']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/featurestore_online_serving_service_client.ts b/src/v1/featurestore_online_serving_service_client.ts index 49bde791..b9b6636f 100644 --- a/src/v1/featurestore_online_serving_service_client.ts +++ b/src/v1/featurestore_online_serving_service_client.ts @@ -1501,7 +1501,7 @@ export class FeaturestoreOnlineServingServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.readFeatureValues(request, options, callback); @@ -1548,7 +1548,7 @@ export class FeaturestoreOnlineServingServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.streamingReadFeatureValues(request, options); diff --git a/src/v1/featurestore_service_client.ts b/src/v1/featurestore_service_client.ts index 439a7a0e..27a46717 100644 --- a/src/v1/featurestore_service_client.ts +++ b/src/v1/featurestore_service_client.ts @@ -1648,7 +1648,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getFeaturestore(request, options, callback); @@ -1741,7 +1741,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getEntityType(request, options, callback); @@ -1855,7 +1855,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'entity_type.name': request.entityType!.name || '', + 'entity_type.name': request.entityType!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateEntityType(request, options, callback); @@ -1942,7 +1942,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getFeature(request, options, callback); @@ -2050,7 +2050,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'feature.name': request.feature!.name || '', + 'feature.name': request.feature!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeature(request, options, callback); @@ -2166,7 +2166,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFeaturestore(request, options, callback); @@ -2321,7 +2321,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'featurestore.name': request.featurestore!.name || '', + 'featurestore.name': request.featurestore!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeaturestore(request, options, callback); @@ -2466,7 +2466,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteFeaturestore(request, options, callback); @@ -2616,7 +2616,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createEntityType(request, options, callback); @@ -2760,7 +2760,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteEntityType(request, options, callback); @@ -2910,7 +2910,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFeature(request, options, callback); @@ -3055,7 +3055,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateFeatures(request, options, callback); @@ -3195,7 +3195,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteFeature(request, options, callback); @@ -3383,7 +3383,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.importFeatureValues(request, options, callback); @@ -3571,7 +3571,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - featurestore: request.featurestore || '', + featurestore: request.featurestore ?? '', }); this.initialize(); return this.innerApiCalls.batchReadFeatureValues( @@ -3727,7 +3727,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.exportFeatureValues(request, options, callback); @@ -3901,7 +3901,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFeaturestores(request, options, callback); @@ -3980,7 +3980,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeaturestores']; const callSettings = defaultCallSettings.merge(options); @@ -4068,7 +4068,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeaturestores']; const callSettings = defaultCallSettings.merge(options); @@ -4213,7 +4213,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listEntityTypes(request, options, callback); @@ -4292,7 +4292,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); @@ -4380,7 +4380,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); @@ -4532,7 +4532,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFeatures(request, options, callback); @@ -4618,7 +4618,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -4713,7 +4713,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -4888,7 +4888,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); this.initialize(); return this.innerApiCalls.searchFeatures(request, options, callback); @@ -4997,7 +4997,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); const defaultCallSettings = this._defaults['searchFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -5115,7 +5115,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); const defaultCallSettings = this._defaults['searchFeatures']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/index_endpoint_service_client.ts b/src/v1/index_endpoint_service_client.ts index b104a081..5121cabe 100644 --- a/src/v1/index_endpoint_service_client.ts +++ b/src/v1/index_endpoint_service_client.ts @@ -1550,7 +1550,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getIndexEndpoint(request, options, callback); @@ -1643,7 +1643,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'index_endpoint.name': request.indexEndpoint!.name || '', + 'index_endpoint.name': request.indexEndpoint!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateIndexEndpoint(request, options, callback); @@ -1750,7 +1750,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createIndexEndpoint(request, options, callback); @@ -1890,7 +1890,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); @@ -2034,7 +2034,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.deployIndex(request, options, callback); @@ -2177,7 +2177,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.undeployIndex(request, options, callback); @@ -2321,7 +2321,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.mutateDeployedIndex(request, options, callback); @@ -2479,7 +2479,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listIndexEndpoints(request, options, callback); @@ -2542,7 +2542,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexEndpoints']; const callSettings = defaultCallSettings.merge(options); @@ -2614,7 +2614,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexEndpoints']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/index_service_client.ts b/src/v1/index_service_client.ts index 1737ae54..bb947da3 100644 --- a/src/v1/index_service_client.ts +++ b/src/v1/index_service_client.ts @@ -1519,7 +1519,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getIndex(request, options, callback); @@ -1614,7 +1614,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index: request.index || '', + index: request.index ?? '', }); this.initialize(); return this.innerApiCalls.upsertDatapoints(request, options, callback); @@ -1709,7 +1709,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index: request.index || '', + index: request.index ?? '', }); this.initialize(); return this.innerApiCalls.removeDatapoints(request, options, callback); @@ -1816,7 +1816,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createIndex(request, options, callback); @@ -1957,7 +1957,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'index.name': request.index!.name || '', + 'index.name': request.index!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateIndex(request, options, callback); @@ -2099,7 +2099,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteIndex(request, options, callback); @@ -2234,7 +2234,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listIndexes(request, options, callback); @@ -2280,7 +2280,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexes']; const callSettings = defaultCallSettings.merge(options); @@ -2335,7 +2335,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexes']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/job_service_client.ts b/src/v1/job_service_client.ts index 953c9f2a..21daa29b 100644 --- a/src/v1/job_service_client.ts +++ b/src/v1/job_service_client.ts @@ -1629,7 +1629,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createCustomJob(request, options, callback); @@ -1716,7 +1716,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getCustomJob(request, options, callback); @@ -1818,7 +1818,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelCustomJob(request, options, callback); @@ -1918,7 +1918,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createDataLabelingJob(request, options, callback); @@ -2011,7 +2011,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getDataLabelingJob(request, options, callback); @@ -2110,7 +2110,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); @@ -2210,7 +2210,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createHyperparameterTuningJob( @@ -2313,7 +2313,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getHyperparameterTuningJob( @@ -2425,7 +2425,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelHyperparameterTuningJob( @@ -2530,7 +2530,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createBatchPredictionJob( @@ -2633,7 +2633,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getBatchPredictionJob(request, options, callback); @@ -2741,7 +2741,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelBatchPredictionJob( @@ -2846,7 +2846,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createModelDeploymentMonitoringJob( @@ -2949,7 +2949,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelDeploymentMonitoringJob( @@ -3054,7 +3054,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.pauseModelDeploymentMonitoringJob( @@ -3159,7 +3159,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.resumeModelDeploymentMonitoringJob( @@ -3269,7 +3269,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteCustomJob(request, options, callback); @@ -3409,7 +3409,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); @@ -3549,7 +3549,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteHyperparameterTuningJob( @@ -3694,7 +3694,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteBatchPredictionJob( @@ -3866,7 +3866,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'model_deployment_monitoring_job.name': - request.modelDeploymentMonitoringJob!.name || '', + request.modelDeploymentMonitoringJob!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateModelDeploymentMonitoringJob( @@ -4010,7 +4010,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModelDeploymentMonitoringJob( @@ -4169,7 +4169,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listCustomJobs(request, options, callback); @@ -4229,7 +4229,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listCustomJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4298,7 +4298,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listCustomJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4428,7 +4428,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDataLabelingJobs(request, options, callback); @@ -4492,7 +4492,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataLabelingJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4565,7 +4565,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataLabelingJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4691,7 +4691,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listHyperparameterTuningJobs( @@ -4755,7 +4755,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4824,7 +4824,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4951,7 +4951,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listBatchPredictionJobs( @@ -5016,7 +5016,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBatchPredictionJobs']; const callSettings = defaultCallSettings.merge(options); @@ -5086,7 +5086,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBatchPredictionJobs']; const callSettings = defaultCallSettings.merge(options); @@ -5211,7 +5211,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); this.initialize(); return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies( @@ -5274,7 +5274,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; @@ -5344,7 +5344,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; @@ -5470,7 +5470,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelDeploymentMonitoringJobs( @@ -5531,7 +5531,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; @@ -5598,7 +5598,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; diff --git a/src/v1/metadata_service_client.ts b/src/v1/metadata_service_client.ts index 13b58977..60024f46 100644 --- a/src/v1/metadata_service_client.ts +++ b/src/v1/metadata_service_client.ts @@ -1629,7 +1629,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getMetadataStore(request, options, callback); @@ -1733,7 +1733,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createArtifact(request, options, callback); @@ -1820,7 +1820,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getArtifact(request, options, callback); @@ -1921,7 +1921,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'artifact.name': request.artifact!.name || '', + 'artifact.name': request.artifact!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateArtifact(request, options, callback); @@ -2025,7 +2025,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createContext(request, options, callback); @@ -2112,7 +2112,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getContext(request, options, callback); @@ -2213,7 +2213,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'context.name': request.context!.name || '', + 'context.name': request.context!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateContext(request, options, callback); @@ -2326,7 +2326,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.addContextArtifactsAndExecutions( @@ -2430,7 +2430,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.addContextChildren(request, options, callback); @@ -2535,7 +2535,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.queryContextLineageSubgraph( @@ -2644,7 +2644,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createExecution(request, options, callback); @@ -2731,7 +2731,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getExecution(request, options, callback); @@ -2832,7 +2832,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'execution.name': request.execution!.name || '', + 'execution.name': request.execution!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateExecution(request, options, callback); @@ -2931,7 +2931,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - execution: request.execution || '', + execution: request.execution ?? '', }); this.initialize(); return this.innerApiCalls.addExecutionEvents(request, options, callback); @@ -3033,7 +3033,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - execution: request.execution || '', + execution: request.execution ?? '', }); this.initialize(); return this.innerApiCalls.queryExecutionInputsAndOutputs( @@ -3148,7 +3148,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createMetadataSchema(request, options, callback); @@ -3241,7 +3241,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getMetadataSchema(request, options, callback); @@ -3374,7 +3374,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - artifact: request.artifact || '', + artifact: request.artifact ?? '', }); this.initialize(); return this.innerApiCalls.queryArtifactLineageSubgraph( @@ -3495,7 +3495,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createMetadataStore(request, options, callback); @@ -3638,7 +3638,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteMetadataStore(request, options, callback); @@ -3782,7 +3782,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteArtifact(request, options, callback); @@ -3929,7 +3929,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeArtifacts(request, options, callback); @@ -4076,7 +4076,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteContext(request, options, callback); @@ -4223,7 +4223,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeContexts(request, options, callback); @@ -4367,7 +4367,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteExecution(request, options, callback); @@ -4514,7 +4514,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeExecutions(request, options, callback); @@ -4657,7 +4657,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listMetadataStores(request, options, callback); @@ -4705,7 +4705,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataStores']; const callSettings = defaultCallSettings.merge(options); @@ -4762,7 +4762,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataStores']; const callSettings = defaultCallSettings.merge(options); @@ -4902,7 +4902,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listArtifacts(request, options, callback); @@ -4976,7 +4976,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); @@ -5059,7 +5059,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); @@ -5203,7 +5203,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listContexts(request, options, callback); @@ -5281,7 +5281,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); @@ -5368,7 +5368,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); @@ -5507,7 +5507,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listExecutions(request, options, callback); @@ -5580,7 +5580,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listExecutions']; const callSettings = defaultCallSettings.merge(options); @@ -5662,7 +5662,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listExecutions']; const callSettings = defaultCallSettings.merge(options); @@ -5778,7 +5778,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listMetadataSchemas(request, options, callback); @@ -5828,7 +5828,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataSchemas']; const callSettings = defaultCallSettings.merge(options); @@ -5887,7 +5887,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataSchemas']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/migration_service_client.ts b/src/v1/migration_service_client.ts index ec9a4c49..bba68cc1 100644 --- a/src/v1/migration_service_client.ts +++ b/src/v1/migration_service_client.ts @@ -1520,7 +1520,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchMigrateResources(request, options, callback); @@ -1673,7 +1673,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.searchMigratableResources( @@ -1733,7 +1733,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['searchMigratableResources']; const callSettings = defaultCallSettings.merge(options); @@ -1798,7 +1798,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['searchMigratableResources']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/model_service_client.ts b/src/v1/model_service_client.ts index 06ac3cce..dbe7797d 100644 --- a/src/v1/model_service_client.ts +++ b/src/v1/model_service_client.ts @@ -1562,7 +1562,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModel(request, options, callback); @@ -1667,7 +1667,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'model.name': request.model!.name || '', + 'model.name': request.model!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateModel(request, options, callback); @@ -1774,7 +1774,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.mergeVersionAliases(request, options, callback); @@ -1874,7 +1874,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.importModelEvaluation(request, options, callback); @@ -1975,7 +1975,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchImportModelEvaluationSlices( @@ -2072,7 +2072,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelEvaluation(request, options, callback); @@ -2171,7 +2171,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelEvaluationSlice( @@ -2291,7 +2291,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.uploadModel(request, options, callback); @@ -2434,7 +2434,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModel(request, options, callback); @@ -2579,7 +2579,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModelVersion(request, options, callback); @@ -2723,7 +2723,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.exportModel(request, options, callback); @@ -2883,7 +2883,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModels(request, options, callback); @@ -2954,7 +2954,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); @@ -3034,7 +3034,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); @@ -3155,7 +3155,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.listModelVersions(request, options, callback); @@ -3210,7 +3210,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); const defaultCallSettings = this._defaults['listModelVersions']; const callSettings = defaultCallSettings.merge(options); @@ -3274,7 +3274,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); const defaultCallSettings = this._defaults['listModelVersions']; const callSettings = defaultCallSettings.merge(options); @@ -3386,7 +3386,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelEvaluations(request, options, callback); @@ -3432,7 +3432,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); @@ -3487,7 +3487,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); @@ -3602,7 +3602,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelEvaluationSlices( @@ -3655,7 +3655,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluationSlices']; const callSettings = defaultCallSettings.merge(options); @@ -3713,7 +3713,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluationSlices']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/pipeline_service_client.ts b/src/v1/pipeline_service_client.ts index 29111dec..ceb88dcb 100644 --- a/src/v1/pipeline_service_client.ts +++ b/src/v1/pipeline_service_client.ts @@ -1538,7 +1538,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTrainingPipeline( @@ -1635,7 +1635,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTrainingPipeline(request, options, callback); @@ -1743,7 +1743,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelTrainingPipeline( @@ -1848,7 +1848,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createPipelineJob(request, options, callback); @@ -1941,7 +1941,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getPipelineJob(request, options, callback); @@ -2043,7 +2043,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelPipelineJob(request, options, callback); @@ -2149,7 +2149,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTrainingPipeline( @@ -2293,7 +2293,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deletePipelineJob(request, options, callback); @@ -2450,7 +2450,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTrainingPipelines(request, options, callback); @@ -2512,7 +2512,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrainingPipelines']; const callSettings = defaultCallSettings.merge(options); @@ -2583,7 +2583,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrainingPipelines']; const callSettings = defaultCallSettings.merge(options); @@ -2742,7 +2742,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listPipelineJobs(request, options, callback); @@ -2835,7 +2835,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listPipelineJobs']; const callSettings = defaultCallSettings.merge(options); @@ -2937,7 +2937,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listPipelineJobs']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/prediction_service_client.ts b/src/v1/prediction_service_client.ts index d7d49033..3c31bb66 100644 --- a/src/v1/prediction_service_client.ts +++ b/src/v1/prediction_service_client.ts @@ -1472,7 +1472,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.predict(request, options, callback); @@ -1581,7 +1581,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.rawPredict(request, options, callback); @@ -1702,7 +1702,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.explain(request, options, callback); diff --git a/src/v1/specialist_pool_service_client.ts b/src/v1/specialist_pool_service_client.ts index 6120cf3e..66ab0597 100644 --- a/src/v1/specialist_pool_service_client.ts +++ b/src/v1/specialist_pool_service_client.ts @@ -1532,7 +1532,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSpecialistPool(request, options, callback); @@ -1639,7 +1639,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createSpecialistPool(request, options, callback); @@ -1782,7 +1782,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteSpecialistPool(request, options, callback); @@ -1922,7 +1922,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'specialist_pool.name': request.specialistPool!.name || '', + 'specialist_pool.name': request.specialistPool!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSpecialistPool(request, options, callback); @@ -2061,7 +2061,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSpecialistPools(request, options, callback); @@ -2105,7 +2105,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSpecialistPools']; const callSettings = defaultCallSettings.merge(options); @@ -2158,7 +2158,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSpecialistPools']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/tensorboard_service_client.ts b/src/v1/tensorboard_service_client.ts index a4e56831..a96220ba 100644 --- a/src/v1/tensorboard_service_client.ts +++ b/src/v1/tensorboard_service_client.ts @@ -1637,7 +1637,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboard(request, options, callback); @@ -1744,7 +1744,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardExperiment( @@ -1847,7 +1847,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardExperiment( @@ -1958,7 +1958,7 @@ export class TensorboardServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'tensorboard_experiment.name': - request.tensorboardExperiment!.name || '', + request.tensorboardExperiment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardExperiment( @@ -2069,7 +2069,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardRun(request, options, callback); @@ -2173,7 +2173,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateTensorboardRuns( @@ -2270,7 +2270,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardRun(request, options, callback); @@ -2376,7 +2376,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'tensorboard_run.name': request.tensorboardRun!.name || '', + 'tensorboard_run.name': request.tensorboardRun!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardRun(request, options, callback); @@ -2482,7 +2482,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateTensorboardTimeSeries( @@ -2593,7 +2593,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardTimeSeries( @@ -2696,7 +2696,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardTimeSeries( @@ -2808,7 +2808,7 @@ export class TensorboardServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'tensorboard_time_series.name': - request.tensorboardTimeSeries!.name || '', + request.tensorboardTimeSeries!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardTimeSeries( @@ -2920,7 +2920,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard: request.tensorboard || '', + tensorboard: request.tensorboard ?? '', }); this.initialize(); return this.innerApiCalls.batchReadTensorboardTimeSeriesData( @@ -3034,7 +3034,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); this.initialize(); return this.innerApiCalls.readTensorboardTimeSeriesData( @@ -3141,7 +3141,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_experiment: request.tensorboardExperiment || '', + tensorboard_experiment: request.tensorboardExperiment ?? '', }); this.initialize(); return this.innerApiCalls.writeTensorboardExperimentData( @@ -3252,7 +3252,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_run: request.tensorboardRun || '', + tensorboard_run: request.tensorboardRun ?? '', }); this.initialize(); return this.innerApiCalls.writeTensorboardRunData( @@ -3296,7 +3296,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - time_series: request.timeSeries || '', + time_series: request.timeSeries ?? '', }); this.initialize(); return this.innerApiCalls.readTensorboardBlobData(request, options); @@ -3403,7 +3403,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboard(request, options, callback); @@ -3550,7 +3550,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'tensorboard.name': request.tensorboard!.name || '', + 'tensorboard.name': request.tensorboard!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboard(request, options, callback); @@ -3690,7 +3690,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboard(request, options, callback); @@ -3830,7 +3830,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardExperiment( @@ -3974,7 +3974,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardRun(request, options, callback); @@ -4114,7 +4114,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardTimeSeries( @@ -4268,7 +4268,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboards(request, options, callback); @@ -4323,7 +4323,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboards']; const callSettings = defaultCallSettings.merge(options); @@ -4387,7 +4387,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboards']; const callSettings = defaultCallSettings.merge(options); @@ -4508,7 +4508,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardExperiments( @@ -4567,7 +4567,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardExperiments']; const callSettings = defaultCallSettings.merge(options); @@ -4631,7 +4631,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardExperiments']; const callSettings = defaultCallSettings.merge(options); @@ -4752,7 +4752,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardRuns(request, options, callback); @@ -4807,7 +4807,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardRuns']; const callSettings = defaultCallSettings.merge(options); @@ -4871,7 +4871,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardRuns']; const callSettings = defaultCallSettings.merge(options); @@ -4992,7 +4992,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardTimeSeries( @@ -5051,7 +5051,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; const callSettings = defaultCallSettings.merge(options); @@ -5115,7 +5115,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; const callSettings = defaultCallSettings.merge(options); @@ -5236,7 +5236,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); this.initialize(); return this.innerApiCalls.exportTensorboardTimeSeriesData( @@ -5294,7 +5294,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; @@ -5358,7 +5358,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; diff --git a/src/v1/vizier_service_client.ts b/src/v1/vizier_service_client.ts index 17061cff..41a69050 100644 --- a/src/v1/vizier_service_client.ts +++ b/src/v1/vizier_service_client.ts @@ -1533,7 +1533,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createStudy(request, options, callback); @@ -1617,7 +1617,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getStudy(request, options, callback); @@ -1703,7 +1703,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteStudy(request, options, callback); @@ -1792,7 +1792,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.lookupStudy(request, options, callback); @@ -1880,7 +1880,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTrial(request, options, callback); @@ -1965,7 +1965,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTrial(request, options, callback); @@ -2061,7 +2061,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - trial_name: request.trialName || '', + trial_name: request.trialName ?? '', }); this.initialize(); return this.innerApiCalls.addTrialMeasurement(request, options, callback); @@ -2164,7 +2164,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.completeTrial(request, options, callback); @@ -2251,7 +2251,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTrial(request, options, callback); @@ -2338,7 +2338,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.stopTrial(request, options, callback); @@ -2432,7 +2432,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listOptimalTrials(request, options, callback); @@ -2549,7 +2549,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.suggestTrials(request, options, callback); @@ -2692,7 +2692,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - trial_name: request.trialName || '', + trial_name: request.trialName ?? '', }); this.initialize(); return this.innerApiCalls.checkTrialEarlyStoppingState( @@ -2826,7 +2826,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listStudies(request, options, callback); @@ -2867,7 +2867,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listStudies']; const callSettings = defaultCallSettings.merge(options); @@ -2917,7 +2917,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listStudies']; const callSettings = defaultCallSettings.merge(options); @@ -3018,7 +3018,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTrials(request, options, callback); @@ -3059,7 +3059,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrials']; const callSettings = defaultCallSettings.merge(options); @@ -3109,7 +3109,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrials']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/dataset_service_client.ts b/src/v1beta1/dataset_service_client.ts index 34fcd606..748e4e0d 100644 --- a/src/v1beta1/dataset_service_client.ts +++ b/src/v1beta1/dataset_service_client.ts @@ -1626,7 +1626,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getDataset(request, options, callback); @@ -1725,7 +1725,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'dataset.name': request.dataset!.name || '', + 'dataset.name': request.dataset!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateDataset(request, options, callback); @@ -1826,7 +1826,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getAnnotationSpec(request, options, callback); @@ -1933,7 +1933,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createDataset(request, options, callback); @@ -2073,7 +2073,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteDataset(request, options, callback); @@ -2216,7 +2216,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.importData(request, options, callback); @@ -2358,7 +2358,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.exportData(request, options, callback); @@ -2517,7 +2517,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDatasets(request, options, callback); @@ -2581,7 +2581,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); @@ -2654,7 +2654,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); @@ -2767,7 +2767,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDataItems(request, options, callback); @@ -2814,7 +2814,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataItems']; const callSettings = defaultCallSettings.merge(options); @@ -2870,7 +2870,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataItems']; const callSettings = defaultCallSettings.merge(options); @@ -2983,7 +2983,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSavedQueries(request, options, callback); @@ -3030,7 +3030,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); @@ -3086,7 +3086,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); @@ -3199,7 +3199,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAnnotations(request, options, callback); @@ -3246,7 +3246,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAnnotations']; const callSettings = defaultCallSettings.merge(options); @@ -3302,7 +3302,7 @@ export class DatasetServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAnnotations']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/deployment_resource_pool_service_client.ts b/src/v1beta1/deployment_resource_pool_service_client.ts index f4ef8b4e..c0055dc2 100644 --- a/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/src/v1beta1/deployment_resource_pool_service_client.ts @@ -1606,7 +1606,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getDeploymentResourcePool( @@ -1724,7 +1724,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createDeploymentResourcePool( @@ -1868,7 +1868,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteDeploymentResourcePool( @@ -2012,7 +2012,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDeploymentResourcePools( @@ -2061,7 +2061,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDeploymentResourcePools']; const callSettings = defaultCallSettings.merge(options); @@ -2115,7 +2115,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDeploymentResourcePools']; const callSettings = defaultCallSettings.merge(options); @@ -2227,7 +2227,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - deployment_resource_pool: request.deploymentResourcePool || '', + deployment_resource_pool: request.deploymentResourcePool ?? '', }); this.initialize(); return this.innerApiCalls.queryDeployedModels(request, options, callback); @@ -2273,7 +2273,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - deployment_resource_pool: request.deploymentResourcePool || '', + deployment_resource_pool: request.deploymentResourcePool ?? '', }); const defaultCallSettings = this._defaults['queryDeployedModels']; const callSettings = defaultCallSettings.merge(options); @@ -2328,7 +2328,7 @@ export class DeploymentResourcePoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - deployment_resource_pool: request.deploymentResourcePool || '', + deployment_resource_pool: request.deploymentResourcePool ?? '', }); const defaultCallSettings = this._defaults['queryDeployedModels']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/endpoint_service_client.ts b/src/v1beta1/endpoint_service_client.ts index 7a234bb3..4c9bbd32 100644 --- a/src/v1beta1/endpoint_service_client.ts +++ b/src/v1beta1/endpoint_service_client.ts @@ -1606,7 +1606,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getEndpoint(request, options, callback); @@ -1699,7 +1699,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'endpoint.name': request.endpoint!.name || '', + 'endpoint.name': request.endpoint!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateEndpoint(request, options, callback); @@ -1815,7 +1815,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createEndpoint(request, options, callback); @@ -1955,7 +1955,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteEndpoint(request, options, callback); @@ -2112,7 +2112,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.deployModel(request, options, callback); @@ -2263,7 +2263,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.undeployModel(request, options, callback); @@ -2418,7 +2418,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listEndpoints(request, options, callback); @@ -2478,7 +2478,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEndpoints']; const callSettings = defaultCallSettings.merge(options); @@ -2547,7 +2547,7 @@ export class EndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEndpoints']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/featurestore_online_serving_service_client.ts b/src/v1beta1/featurestore_online_serving_service_client.ts index 41657a8b..7d434919 100644 --- a/src/v1beta1/featurestore_online_serving_service_client.ts +++ b/src/v1beta1/featurestore_online_serving_service_client.ts @@ -1576,7 +1576,7 @@ export class FeaturestoreOnlineServingServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.readFeatureValues(request, options, callback); @@ -1684,7 +1684,7 @@ export class FeaturestoreOnlineServingServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.writeFeatureValues(request, options, callback); @@ -1731,7 +1731,7 @@ export class FeaturestoreOnlineServingServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.streamingReadFeatureValues(request, options); diff --git a/src/v1beta1/featurestore_service_client.ts b/src/v1beta1/featurestore_service_client.ts index 015506ec..7805fa3c 100644 --- a/src/v1beta1/featurestore_service_client.ts +++ b/src/v1beta1/featurestore_service_client.ts @@ -1723,7 +1723,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getFeaturestore(request, options, callback); @@ -1816,7 +1816,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getEntityType(request, options, callback); @@ -1936,7 +1936,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'entity_type.name': request.entityType!.name || '', + 'entity_type.name': request.entityType!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateEntityType(request, options, callback); @@ -2029,7 +2029,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getFeature(request, options, callback); @@ -2137,7 +2137,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'feature.name': request.feature!.name || '', + 'feature.name': request.feature!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeature(request, options, callback); @@ -2253,7 +2253,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFeaturestore(request, options, callback); @@ -2408,7 +2408,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'featurestore.name': request.featurestore!.name || '', + 'featurestore.name': request.featurestore!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateFeaturestore(request, options, callback); @@ -2553,7 +2553,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteFeaturestore(request, options, callback); @@ -2703,7 +2703,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createEntityType(request, options, callback); @@ -2847,7 +2847,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteEntityType(request, options, callback); @@ -2997,7 +2997,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createFeature(request, options, callback); @@ -3142,7 +3142,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateFeatures(request, options, callback); @@ -3282,7 +3282,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteFeature(request, options, callback); @@ -3470,7 +3470,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.importFeatureValues(request, options, callback); @@ -3658,7 +3658,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - featurestore: request.featurestore || '', + featurestore: request.featurestore ?? '', }); this.initialize(); return this.innerApiCalls.batchReadFeatureValues( @@ -3814,7 +3814,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - entity_type: request.entityType || '', + entity_type: request.entityType ?? '', }); this.initialize(); return this.innerApiCalls.exportFeatureValues(request, options, callback); @@ -3988,7 +3988,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFeaturestores(request, options, callback); @@ -4067,7 +4067,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeaturestores']; const callSettings = defaultCallSettings.merge(options); @@ -4155,7 +4155,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeaturestores']; const callSettings = defaultCallSettings.merge(options); @@ -4300,7 +4300,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listEntityTypes(request, options, callback); @@ -4379,7 +4379,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); @@ -4467,7 +4467,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); @@ -4619,7 +4619,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listFeatures(request, options, callback); @@ -4705,7 +4705,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -4800,7 +4800,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -4975,7 +4975,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); this.initialize(); return this.innerApiCalls.searchFeatures(request, options, callback); @@ -5084,7 +5084,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); const defaultCallSettings = this._defaults['searchFeatures']; const callSettings = defaultCallSettings.merge(options); @@ -5202,7 +5202,7 @@ export class FeaturestoreServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - location: request.location || '', + location: request.location ?? '', }); const defaultCallSettings = this._defaults['searchFeatures']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/index_endpoint_service_client.ts b/src/v1beta1/index_endpoint_service_client.ts index 9c63c400..1021257b 100644 --- a/src/v1beta1/index_endpoint_service_client.ts +++ b/src/v1beta1/index_endpoint_service_client.ts @@ -1625,7 +1625,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getIndexEndpoint(request, options, callback); @@ -1724,7 +1724,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'index_endpoint.name': request.indexEndpoint!.name || '', + 'index_endpoint.name': request.indexEndpoint!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateIndexEndpoint(request, options, callback); @@ -1831,7 +1831,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createIndexEndpoint(request, options, callback); @@ -1971,7 +1971,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteIndexEndpoint(request, options, callback); @@ -2115,7 +2115,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.deployIndex(request, options, callback); @@ -2258,7 +2258,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.undeployIndex(request, options, callback); @@ -2402,7 +2402,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index_endpoint: request.indexEndpoint || '', + index_endpoint: request.indexEndpoint ?? '', }); this.initialize(); return this.innerApiCalls.mutateDeployedIndex(request, options, callback); @@ -2560,7 +2560,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listIndexEndpoints(request, options, callback); @@ -2623,7 +2623,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexEndpoints']; const callSettings = defaultCallSettings.merge(options); @@ -2695,7 +2695,7 @@ export class IndexEndpointServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexEndpoints']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/index_service_client.ts b/src/v1beta1/index_service_client.ts index 175e6939..fbd51907 100644 --- a/src/v1beta1/index_service_client.ts +++ b/src/v1beta1/index_service_client.ts @@ -1595,7 +1595,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getIndex(request, options, callback); @@ -1696,7 +1696,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index: request.index || '', + index: request.index ?? '', }); this.initialize(); return this.innerApiCalls.upsertDatapoints(request, options, callback); @@ -1797,7 +1797,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - index: request.index || '', + index: request.index ?? '', }); this.initialize(); return this.innerApiCalls.removeDatapoints(request, options, callback); @@ -1904,7 +1904,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createIndex(request, options, callback); @@ -2045,7 +2045,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'index.name': request.index!.name || '', + 'index.name': request.index!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateIndex(request, options, callback); @@ -2187,7 +2187,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteIndex(request, options, callback); @@ -2328,7 +2328,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listIndexes(request, options, callback); @@ -2374,7 +2374,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexes']; const callSettings = defaultCallSettings.merge(options); @@ -2429,7 +2429,7 @@ export class IndexServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listIndexes']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/job_service_client.ts b/src/v1beta1/job_service_client.ts index 1410cffa..0322d5ff 100644 --- a/src/v1beta1/job_service_client.ts +++ b/src/v1beta1/job_service_client.ts @@ -1703,7 +1703,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createCustomJob(request, options, callback); @@ -1796,7 +1796,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getCustomJob(request, options, callback); @@ -1904,7 +1904,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelCustomJob(request, options, callback); @@ -2004,7 +2004,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createDataLabelingJob(request, options, callback); @@ -2103,7 +2103,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getDataLabelingJob(request, options, callback); @@ -2202,7 +2202,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelDataLabelingJob(request, options, callback); @@ -2302,7 +2302,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createHyperparameterTuningJob( @@ -2405,7 +2405,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getHyperparameterTuningJob( @@ -2517,7 +2517,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelHyperparameterTuningJob( @@ -2622,7 +2622,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createBatchPredictionJob( @@ -2725,7 +2725,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getBatchPredictionJob(request, options, callback); @@ -2833,7 +2833,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelBatchPredictionJob( @@ -2938,7 +2938,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createModelDeploymentMonitoringJob( @@ -3041,7 +3041,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelDeploymentMonitoringJob( @@ -3146,7 +3146,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.pauseModelDeploymentMonitoringJob( @@ -3251,7 +3251,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.resumeModelDeploymentMonitoringJob( @@ -3361,7 +3361,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteCustomJob(request, options, callback); @@ -3501,7 +3501,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteDataLabelingJob(request, options, callback); @@ -3641,7 +3641,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteHyperparameterTuningJob( @@ -3786,7 +3786,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteBatchPredictionJob( @@ -3958,7 +3958,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'model_deployment_monitoring_job.name': - request.modelDeploymentMonitoringJob!.name || '', + request.modelDeploymentMonitoringJob!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateModelDeploymentMonitoringJob( @@ -4102,7 +4102,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModelDeploymentMonitoringJob( @@ -4261,7 +4261,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listCustomJobs(request, options, callback); @@ -4321,7 +4321,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listCustomJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4390,7 +4390,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listCustomJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4520,7 +4520,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDataLabelingJobs(request, options, callback); @@ -4584,7 +4584,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataLabelingJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4657,7 +4657,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDataLabelingJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4783,7 +4783,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listHyperparameterTuningJobs( @@ -4847,7 +4847,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; const callSettings = defaultCallSettings.merge(options); @@ -4916,7 +4916,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listHyperparameterTuningJobs']; const callSettings = defaultCallSettings.merge(options); @@ -5043,7 +5043,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listBatchPredictionJobs( @@ -5108,7 +5108,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBatchPredictionJobs']; const callSettings = defaultCallSettings.merge(options); @@ -5178,7 +5178,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listBatchPredictionJobs']; const callSettings = defaultCallSettings.merge(options); @@ -5303,7 +5303,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); this.initialize(); return this.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies( @@ -5366,7 +5366,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; @@ -5436,7 +5436,7 @@ export class JobServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ model_deployment_monitoring_job: - request.modelDeploymentMonitoringJob || '', + request.modelDeploymentMonitoringJob ?? '', }); const defaultCallSettings = this._defaults['searchModelDeploymentMonitoringStatsAnomalies']; @@ -5562,7 +5562,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelDeploymentMonitoringJobs( @@ -5623,7 +5623,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; @@ -5690,7 +5690,7 @@ export class JobServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelDeploymentMonitoringJobs']; diff --git a/src/v1beta1/metadata_service_client.ts b/src/v1beta1/metadata_service_client.ts index ad3bb89a..b1194ef6 100644 --- a/src/v1beta1/metadata_service_client.ts +++ b/src/v1beta1/metadata_service_client.ts @@ -1703,7 +1703,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getMetadataStore(request, options, callback); @@ -1807,7 +1807,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createArtifact(request, options, callback); @@ -1900,7 +1900,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getArtifact(request, options, callback); @@ -2001,7 +2001,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'artifact.name': request.artifact!.name || '', + 'artifact.name': request.artifact!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateArtifact(request, options, callback); @@ -2105,7 +2105,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createContext(request, options, callback); @@ -2198,7 +2198,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getContext(request, options, callback); @@ -2299,7 +2299,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'context.name': request.context!.name || '', + 'context.name': request.context!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateContext(request, options, callback); @@ -2412,7 +2412,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.addContextArtifactsAndExecutions( @@ -2522,7 +2522,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.addContextChildren(request, options, callback); @@ -2627,7 +2627,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - context: request.context || '', + context: request.context ?? '', }); this.initialize(); return this.innerApiCalls.queryContextLineageSubgraph( @@ -2742,7 +2742,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createExecution(request, options, callback); @@ -2835,7 +2835,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getExecution(request, options, callback); @@ -2942,7 +2942,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'execution.name': request.execution!.name || '', + 'execution.name': request.execution!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateExecution(request, options, callback); @@ -3047,7 +3047,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - execution: request.execution || '', + execution: request.execution ?? '', }); this.initialize(); return this.innerApiCalls.addExecutionEvents(request, options, callback); @@ -3149,7 +3149,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - execution: request.execution || '', + execution: request.execution ?? '', }); this.initialize(); return this.innerApiCalls.queryExecutionInputsAndOutputs( @@ -3264,7 +3264,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createMetadataSchema(request, options, callback); @@ -3363,7 +3363,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getMetadataSchema(request, options, callback); @@ -3496,7 +3496,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - artifact: request.artifact || '', + artifact: request.artifact ?? '', }); this.initialize(); return this.innerApiCalls.queryArtifactLineageSubgraph( @@ -3617,7 +3617,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createMetadataStore(request, options, callback); @@ -3760,7 +3760,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteMetadataStore(request, options, callback); @@ -3904,7 +3904,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteArtifact(request, options, callback); @@ -4051,7 +4051,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeArtifacts(request, options, callback); @@ -4198,7 +4198,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteContext(request, options, callback); @@ -4345,7 +4345,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeContexts(request, options, callback); @@ -4489,7 +4489,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteExecution(request, options, callback); @@ -4636,7 +4636,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.purgeExecutions(request, options, callback); @@ -4779,7 +4779,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listMetadataStores(request, options, callback); @@ -4827,7 +4827,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataStores']; const callSettings = defaultCallSettings.merge(options); @@ -4884,7 +4884,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataStores']; const callSettings = defaultCallSettings.merge(options); @@ -5024,7 +5024,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listArtifacts(request, options, callback); @@ -5098,7 +5098,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); @@ -5181,7 +5181,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); @@ -5325,7 +5325,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listContexts(request, options, callback); @@ -5403,7 +5403,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); @@ -5490,7 +5490,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); @@ -5629,7 +5629,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listExecutions(request, options, callback); @@ -5702,7 +5702,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listExecutions']; const callSettings = defaultCallSettings.merge(options); @@ -5784,7 +5784,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listExecutions']; const callSettings = defaultCallSettings.merge(options); @@ -5900,7 +5900,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listMetadataSchemas(request, options, callback); @@ -5950,7 +5950,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataSchemas']; const callSettings = defaultCallSettings.merge(options); @@ -6009,7 +6009,7 @@ export class MetadataServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listMetadataSchemas']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/migration_service_client.ts b/src/v1beta1/migration_service_client.ts index a816966f..9d7e5ca1 100644 --- a/src/v1beta1/migration_service_client.ts +++ b/src/v1beta1/migration_service_client.ts @@ -1589,7 +1589,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchMigrateResources(request, options, callback); @@ -1742,7 +1742,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.searchMigratableResources( @@ -1802,7 +1802,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['searchMigratableResources']; const callSettings = defaultCallSettings.merge(options); @@ -1867,7 +1867,7 @@ export class MigrationServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['searchMigratableResources']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/model_service_client.ts b/src/v1beta1/model_service_client.ts index 208775f1..a89bb9fd 100644 --- a/src/v1beta1/model_service_client.ts +++ b/src/v1beta1/model_service_client.ts @@ -1654,7 +1654,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModel(request, options, callback); @@ -1765,7 +1765,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'model.name': request.model!.name || '', + 'model.name': request.model!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateModel(request, options, callback); @@ -1878,7 +1878,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.mergeVersionAliases(request, options, callback); @@ -1978,7 +1978,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.importModelEvaluation(request, options, callback); @@ -2079,7 +2079,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchImportModelEvaluationSlices( @@ -2182,7 +2182,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelEvaluation(request, options, callback); @@ -2281,7 +2281,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getModelEvaluationSlice( @@ -2401,7 +2401,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.uploadModel(request, options, callback); @@ -2542,7 +2542,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - model: request.model || '', + model: request.model ?? '', }); this.initialize(); return this.innerApiCalls.updateExplanationDataset( @@ -2689,7 +2689,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModel(request, options, callback); @@ -2834,7 +2834,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteModelVersion(request, options, callback); @@ -2978,7 +2978,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.exportModel(request, options, callback); @@ -3134,7 +3134,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModels(request, options, callback); @@ -3195,7 +3195,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); @@ -3265,7 +3265,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); @@ -3386,7 +3386,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.listModelVersions(request, options, callback); @@ -3441,7 +3441,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); const defaultCallSettings = this._defaults['listModelVersions']; const callSettings = defaultCallSettings.merge(options); @@ -3505,7 +3505,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); const defaultCallSettings = this._defaults['listModelVersions']; const callSettings = defaultCallSettings.merge(options); @@ -3617,7 +3617,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelEvaluations(request, options, callback); @@ -3663,7 +3663,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); @@ -3718,7 +3718,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); @@ -3833,7 +3833,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listModelEvaluationSlices( @@ -3886,7 +3886,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluationSlices']; const callSettings = defaultCallSettings.merge(options); @@ -3944,7 +3944,7 @@ export class ModelServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listModelEvaluationSlices']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/pipeline_service_client.ts b/src/v1beta1/pipeline_service_client.ts index cb1c1948..9720b065 100644 --- a/src/v1beta1/pipeline_service_client.ts +++ b/src/v1beta1/pipeline_service_client.ts @@ -1606,7 +1606,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTrainingPipeline( @@ -1709,7 +1709,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTrainingPipeline(request, options, callback); @@ -1817,7 +1817,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelTrainingPipeline( @@ -1928,7 +1928,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createPipelineJob(request, options, callback); @@ -2021,7 +2021,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getPipelineJob(request, options, callback); @@ -2129,7 +2129,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.cancelPipelineJob(request, options, callback); @@ -2235,7 +2235,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTrainingPipeline( @@ -2379,7 +2379,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deletePipelineJob(request, options, callback); @@ -2536,7 +2536,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTrainingPipelines(request, options, callback); @@ -2598,7 +2598,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrainingPipelines']; const callSettings = defaultCallSettings.merge(options); @@ -2669,7 +2669,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrainingPipelines']; const callSettings = defaultCallSettings.merge(options); @@ -2826,7 +2826,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listPipelineJobs(request, options, callback); @@ -2917,7 +2917,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listPipelineJobs']; const callSettings = defaultCallSettings.merge(options); @@ -3017,7 +3017,7 @@ export class PipelineServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listPipelineJobs']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/prediction_service_client.ts b/src/v1beta1/prediction_service_client.ts index 9ea08805..5637e71d 100644 --- a/src/v1beta1/prediction_service_client.ts +++ b/src/v1beta1/prediction_service_client.ts @@ -1543,7 +1543,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.predict(request, options, callback); @@ -1658,7 +1658,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.rawPredict(request, options, callback); @@ -1781,7 +1781,7 @@ export class PredictionServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - endpoint: request.endpoint || '', + endpoint: request.endpoint ?? '', }); this.initialize(); return this.innerApiCalls.explain(request, options, callback); diff --git a/src/v1beta1/specialist_pool_service_client.ts b/src/v1beta1/specialist_pool_service_client.ts index 7cef0f40..2746d012 100644 --- a/src/v1beta1/specialist_pool_service_client.ts +++ b/src/v1beta1/specialist_pool_service_client.ts @@ -1606,7 +1606,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSpecialistPool(request, options, callback); @@ -1713,7 +1713,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createSpecialistPool(request, options, callback); @@ -1856,7 +1856,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteSpecialistPool(request, options, callback); @@ -1996,7 +1996,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'specialist_pool.name': request.specialistPool!.name || '', + 'specialist_pool.name': request.specialistPool!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateSpecialistPool(request, options, callback); @@ -2135,7 +2135,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listSpecialistPools(request, options, callback); @@ -2179,7 +2179,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSpecialistPools']; const callSettings = defaultCallSettings.merge(options); @@ -2232,7 +2232,7 @@ export class SpecialistPoolServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listSpecialistPools']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/tensorboard_service_client.ts b/src/v1beta1/tensorboard_service_client.ts index 28668861..beb5e659 100644 --- a/src/v1beta1/tensorboard_service_client.ts +++ b/src/v1beta1/tensorboard_service_client.ts @@ -1703,7 +1703,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboard(request, options, callback); @@ -1810,7 +1810,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardExperiment( @@ -1913,7 +1913,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardExperiment( @@ -2024,7 +2024,7 @@ export class TensorboardServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'tensorboard_experiment.name': - request.tensorboardExperiment!.name || '', + request.tensorboardExperiment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardExperiment( @@ -2135,7 +2135,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardRun(request, options, callback); @@ -2239,7 +2239,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateTensorboardRuns( @@ -2342,7 +2342,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardRun(request, options, callback); @@ -2448,7 +2448,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'tensorboard_run.name': request.tensorboardRun!.name || '', + 'tensorboard_run.name': request.tensorboardRun!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardRun(request, options, callback); @@ -2554,7 +2554,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.batchCreateTensorboardTimeSeries( @@ -2665,7 +2665,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboardTimeSeries( @@ -2768,7 +2768,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTensorboardTimeSeries( @@ -2880,7 +2880,7 @@ export class TensorboardServiceClient { options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ 'tensorboard_time_series.name': - request.tensorboardTimeSeries!.name || '', + request.tensorboardTimeSeries!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboardTimeSeries( @@ -2992,7 +2992,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard: request.tensorboard || '', + tensorboard: request.tensorboard ?? '', }); this.initialize(); return this.innerApiCalls.batchReadTensorboardTimeSeriesData( @@ -3106,7 +3106,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); this.initialize(); return this.innerApiCalls.readTensorboardTimeSeriesData( @@ -3213,7 +3213,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_experiment: request.tensorboardExperiment || '', + tensorboard_experiment: request.tensorboardExperiment ?? '', }); this.initialize(); return this.innerApiCalls.writeTensorboardExperimentData( @@ -3324,7 +3324,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_run: request.tensorboardRun || '', + tensorboard_run: request.tensorboardRun ?? '', }); this.initialize(); return this.innerApiCalls.writeTensorboardRunData( @@ -3368,7 +3368,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - time_series: request.timeSeries || '', + time_series: request.timeSeries ?? '', }); this.initialize(); return this.innerApiCalls.readTensorboardBlobData(request, options); @@ -3475,7 +3475,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTensorboard(request, options, callback); @@ -3622,7 +3622,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'tensorboard.name': request.tensorboard!.name || '', + 'tensorboard.name': request.tensorboard!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateTensorboard(request, options, callback); @@ -3762,7 +3762,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboard(request, options, callback); @@ -3902,7 +3902,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardExperiment( @@ -4046,7 +4046,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardRun(request, options, callback); @@ -4186,7 +4186,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTensorboardTimeSeries( @@ -4340,7 +4340,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboards(request, options, callback); @@ -4395,7 +4395,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboards']; const callSettings = defaultCallSettings.merge(options); @@ -4459,7 +4459,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboards']; const callSettings = defaultCallSettings.merge(options); @@ -4580,7 +4580,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardExperiments( @@ -4639,7 +4639,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardExperiments']; const callSettings = defaultCallSettings.merge(options); @@ -4703,7 +4703,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardExperiments']; const callSettings = defaultCallSettings.merge(options); @@ -4824,7 +4824,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardRuns(request, options, callback); @@ -4879,7 +4879,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardRuns']; const callSettings = defaultCallSettings.merge(options); @@ -4943,7 +4943,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardRuns']; const callSettings = defaultCallSettings.merge(options); @@ -5064,7 +5064,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTensorboardTimeSeries( @@ -5123,7 +5123,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; const callSettings = defaultCallSettings.merge(options); @@ -5187,7 +5187,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTensorboardTimeSeries']; const callSettings = defaultCallSettings.merge(options); @@ -5308,7 +5308,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); this.initialize(); return this.innerApiCalls.exportTensorboardTimeSeriesData( @@ -5366,7 +5366,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; @@ -5430,7 +5430,7 @@ export class TensorboardServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - tensorboard_time_series: request.tensorboardTimeSeries || '', + tensorboard_time_series: request.tensorboardTimeSeries ?? '', }); const defaultCallSettings = this._defaults['exportTensorboardTimeSeriesData']; diff --git a/src/v1beta1/vizier_service_client.ts b/src/v1beta1/vizier_service_client.ts index 7962ed47..afeacfbe 100644 --- a/src/v1beta1/vizier_service_client.ts +++ b/src/v1beta1/vizier_service_client.ts @@ -1607,7 +1607,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createStudy(request, options, callback); @@ -1699,7 +1699,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getStudy(request, options, callback); @@ -1791,7 +1791,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteStudy(request, options, callback); @@ -1886,7 +1886,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.lookupStudy(request, options, callback); @@ -1980,7 +1980,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createTrial(request, options, callback); @@ -2073,7 +2073,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getTrial(request, options, callback); @@ -2175,7 +2175,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - trial_name: request.trialName || '', + trial_name: request.trialName ?? '', }); this.initialize(); return this.innerApiCalls.addTrialMeasurement(request, options, callback); @@ -2278,7 +2278,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.completeTrial(request, options, callback); @@ -2371,7 +2371,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteTrial(request, options, callback); @@ -2464,7 +2464,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.stopTrial(request, options, callback); @@ -2564,7 +2564,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listOptimalTrials(request, options, callback); @@ -2681,7 +2681,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.suggestTrials(request, options, callback); @@ -2824,7 +2824,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - trial_name: request.trialName || '', + trial_name: request.trialName ?? '', }); this.initialize(); return this.innerApiCalls.checkTrialEarlyStoppingState( @@ -2964,7 +2964,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listStudies(request, options, callback); @@ -3005,7 +3005,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listStudies']; const callSettings = defaultCallSettings.merge(options); @@ -3055,7 +3055,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listStudies']; const callSettings = defaultCallSettings.merge(options); @@ -3162,7 +3162,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listTrials(request, options, callback); @@ -3203,7 +3203,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrials']; const callSettings = defaultCallSettings.merge(options); @@ -3253,7 +3253,7 @@ export class VizierServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listTrials']; const callSettings = defaultCallSettings.merge(options); diff --git a/test/gapic_dataset_service_v1.ts b/test/gapic_dataset_service_v1.ts index ea86c9f1..e0419eaf 100644 --- a/test/gapic_dataset_service_v1.ts +++ b/test/gapic_dataset_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -322,11 +328,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset with error', async () => { @@ -338,26 +347,23 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset with closed client', async () => { @@ -369,7 +375,8 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetDatasetRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getDataset(request), expectedError); @@ -386,27 +393,27 @@ describe('v1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset without error using callback', async () => { @@ -418,16 +425,13 @@ describe('v1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -450,11 +454,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset with error', async () => { @@ -466,27 +473,27 @@ describe('v1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset with closed client', async () => { @@ -498,8 +505,12 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateDatasetRequest() ); - request.dataset = {}; - request.dataset.name = ''; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateDataset(request), expectedError); @@ -516,26 +527,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec without error using callback', async () => { @@ -547,15 +557,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AnnotationSpec() ); @@ -578,11 +584,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec with error', async () => { @@ -594,26 +603,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec with closed client', async () => { @@ -625,7 +633,10 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetAnnotationSpecRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getAnnotationSpec(request), expectedError); @@ -642,15 +653,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -659,11 +666,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset without error using callback', async () => { @@ -675,15 +685,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -713,11 +719,14 @@ describe('v1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset with call error', async () => { @@ -729,26 +738,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset with LRO error', async () => { @@ -760,15 +768,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -777,11 +781,14 @@ describe('v1.DatasetServiceClient', () => { ); const [operation] = await client.createDataset(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateDatasetProgress without error', async () => { @@ -836,15 +843,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -853,11 +856,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset without error using callback', async () => { @@ -869,15 +875,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -907,11 +909,14 @@ describe('v1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset with call error', async () => { @@ -923,26 +928,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset with LRO error', async () => { @@ -954,15 +958,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -971,11 +971,14 @@ describe('v1.DatasetServiceClient', () => { ); const [operation] = await client.deleteDataset(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteDatasetProgress without error', async () => { @@ -1030,15 +1033,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1046,11 +1043,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData without error using callback', async () => { @@ -1062,15 +1062,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1100,11 +1094,14 @@ describe('v1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData with call error', async () => { @@ -1116,26 +1113,23 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData with LRO error', async () => { @@ -1147,15 +1141,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1164,11 +1152,14 @@ describe('v1.DatasetServiceClient', () => { ); const [operation] = await client.importData(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.importData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkImportDataProgress without error', async () => { @@ -1220,15 +1211,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1236,11 +1221,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData without error using callback', async () => { @@ -1252,15 +1240,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1290,11 +1272,14 @@ describe('v1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData with call error', async () => { @@ -1306,26 +1291,23 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData with LRO error', async () => { @@ -1337,15 +1319,9 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1354,11 +1330,14 @@ describe('v1.DatasetServiceClient', () => { ); const [operation] = await client.exportData(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportDataProgress without error', async () => { @@ -1410,15 +1389,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -1427,11 +1402,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasets without error using callback', async () => { @@ -1443,15 +1421,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -1476,11 +1450,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasets with error', async () => { @@ -1492,26 +1469,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasetsStream without error', async () => { @@ -1523,8 +1499,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -1555,11 +1534,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1572,8 +1552,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -1601,11 +1584,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1618,8 +1602,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -1639,11 +1626,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1656,8 +1644,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1674,11 +1665,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1693,15 +1685,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -1710,11 +1698,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItems without error using callback', async () => { @@ -1726,15 +1717,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -1759,11 +1746,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItems with error', async () => { @@ -1775,26 +1765,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItemsStream without error', async () => { @@ -1806,8 +1795,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -1838,11 +1830,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1855,8 +1848,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1882,11 +1878,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1899,8 +1896,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -1920,11 +1920,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1937,8 +1938,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1955,11 +1959,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1974,15 +1979,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -1997,11 +1998,14 @@ describe('v1.DatasetServiceClient', () => { client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); const [response] = await client.listSavedQueries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries without error using callback', async () => { @@ -2013,15 +2017,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -2052,11 +2052,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries with error', async () => { @@ -2068,26 +2071,25 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSavedQueries(request), expectedError); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueriesStream without error', async () => { @@ -2099,8 +2101,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -2137,11 +2142,12 @@ describe('v1.DatasetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2154,8 +2160,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2181,11 +2190,12 @@ describe('v1.DatasetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2198,8 +2208,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -2225,11 +2238,12 @@ describe('v1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2242,8 +2256,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2260,11 +2277,12 @@ describe('v1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2279,15 +2297,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -2302,11 +2316,14 @@ describe('v1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotations without error using callback', async () => { @@ -2318,15 +2335,11 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -2357,11 +2370,14 @@ describe('v1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotations with error', async () => { @@ -2373,26 +2389,25 @@ describe('v1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotationsStream without error', async () => { @@ -2404,8 +2419,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -2442,11 +2460,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2459,8 +2478,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2486,11 +2508,12 @@ describe('v1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2503,8 +2526,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -2530,11 +2556,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2547,8 +2574,11 @@ describe('v1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2565,11 +2595,12 @@ describe('v1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3044,12 +3075,15 @@ describe('v1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3080,12 +3114,15 @@ describe('v1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_dataset_service_v1beta1.ts b/test/gapic_dataset_service_v1beta1.ts index e589b4b9..1e9a83d6 100644 --- a/test/gapic_dataset_service_v1beta1.ts +++ b/test/gapic_dataset_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -322,11 +328,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset with error', async () => { @@ -338,26 +347,23 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataset with closed client', async () => { @@ -369,7 +375,8 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDatasetRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetDatasetRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getDataset(request), expectedError); @@ -386,27 +393,27 @@ describe('v1beta1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset without error using callback', async () => { @@ -418,16 +425,13 @@ describe('v1beta1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -450,11 +454,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset with error', async () => { @@ -466,27 +473,27 @@ describe('v1beta1.DatasetServiceClient', () => { 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, - }, - }, - }; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateDataset with closed client', async () => { @@ -498,8 +505,12 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateDatasetRequest() ); - request.dataset = {}; - request.dataset.name = ''; + request.dataset ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateDatasetRequest', [ + 'dataset', + 'name', + ]); + request.dataset.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateDataset(request), expectedError); @@ -516,26 +527,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec without error using callback', async () => { @@ -547,15 +557,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec() ); @@ -578,11 +584,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAnnotationSpec as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec with error', async () => { @@ -594,26 +603,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAnnotationSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAnnotationSpec with closed client', async () => { @@ -625,7 +633,10 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetAnnotationSpecRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetAnnotationSpecRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getAnnotationSpec(request), expectedError); @@ -642,15 +653,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -659,11 +666,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset without error using callback', async () => { @@ -675,15 +685,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -713,11 +719,14 @@ describe('v1beta1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset with call error', async () => { @@ -729,26 +738,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataset with LRO error', async () => { @@ -760,15 +768,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateDatasetRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -777,11 +781,14 @@ describe('v1beta1.DatasetServiceClient', () => { ); const [operation] = await client.createDataset(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateDatasetProgress without error', async () => { @@ -836,15 +843,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -853,11 +856,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset without error using callback', async () => { @@ -869,15 +875,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -907,11 +909,14 @@ describe('v1beta1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset with call error', async () => { @@ -923,26 +928,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataset with LRO error', async () => { @@ -954,15 +958,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteDatasetRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -971,11 +971,14 @@ describe('v1beta1.DatasetServiceClient', () => { ); const [operation] = await client.deleteDataset(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteDatasetProgress without error', async () => { @@ -1030,15 +1033,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1046,11 +1043,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData without error using callback', async () => { @@ -1062,15 +1062,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1100,11 +1094,14 @@ describe('v1beta1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData with call error', async () => { @@ -1116,26 +1113,23 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importData with LRO error', async () => { @@ -1147,15 +1141,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1164,11 +1152,14 @@ describe('v1beta1.DatasetServiceClient', () => { ); const [operation] = await client.importData(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.importData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkImportDataProgress without error', async () => { @@ -1220,15 +1211,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1236,11 +1221,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData without error using callback', async () => { @@ -1252,15 +1240,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1290,11 +1272,14 @@ describe('v1beta1.DatasetServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData with call error', async () => { @@ -1306,26 +1291,23 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportData with LRO error', async () => { @@ -1337,15 +1319,9 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportDataRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1354,11 +1330,14 @@ describe('v1beta1.DatasetServiceClient', () => { ); const [operation] = await client.exportData(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportDataProgress without error', async () => { @@ -1410,15 +1389,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -1433,11 +1408,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasets without error using callback', async () => { @@ -1449,15 +1427,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -1488,11 +1462,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDatasets as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasets with error', async () => { @@ -1504,26 +1481,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDatasets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDatasetsStream without error', async () => { @@ -1535,8 +1511,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -1573,11 +1552,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1590,8 +1570,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -1619,11 +1602,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDatasets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1636,8 +1620,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -1663,11 +1650,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1680,8 +1668,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDatasetsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDatasetsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1698,11 +1689,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDatasets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1717,15 +1709,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -1740,11 +1728,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItems without error using callback', async () => { @@ -1756,15 +1747,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -1795,11 +1782,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataItems as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItems with error', async () => { @@ -1811,26 +1801,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataItems as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataItemsStream without error', async () => { @@ -1842,8 +1831,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -1880,11 +1872,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1897,8 +1890,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1924,11 +1920,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataItems.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1941,8 +1938,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -1968,11 +1968,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1985,8 +1986,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataItemsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataItemsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2004,11 +2008,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataItems.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2023,15 +2028,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -2046,11 +2047,14 @@ describe('v1beta1.DatasetServiceClient', () => { client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); const [response] = await client.listSavedQueries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries without error using callback', async () => { @@ -2062,15 +2066,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -2101,11 +2101,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueries with error', async () => { @@ -2117,26 +2120,25 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listSavedQueries(request), expectedError); - assert( - (client.innerApiCalls.listSavedQueries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSavedQueries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSavedQueriesStream without error', async () => { @@ -2148,8 +2150,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -2187,11 +2192,12 @@ describe('v1beta1.DatasetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2204,8 +2210,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2232,11 +2241,12 @@ describe('v1beta1.DatasetServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listSavedQueries, request) ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2249,8 +2259,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -2277,11 +2290,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2294,8 +2308,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSavedQueriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSavedQueriesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2313,11 +2330,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listSavedQueries.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2332,15 +2350,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -2355,11 +2369,14 @@ describe('v1beta1.DatasetServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotations without error using callback', async () => { @@ -2371,15 +2388,11 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -2410,11 +2423,14 @@ describe('v1beta1.DatasetServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAnnotations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotations with error', async () => { @@ -2426,26 +2442,25 @@ describe('v1beta1.DatasetServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAnnotations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAnnotationsStream without error', async () => { @@ -2457,8 +2472,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -2496,11 +2514,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2513,8 +2532,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2541,11 +2563,12 @@ describe('v1beta1.DatasetServiceClient', () => { .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 + assert( + (client.descriptors.page.listAnnotations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2558,8 +2581,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -2586,11 +2612,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2603,8 +2630,11 @@ describe('v1beta1.DatasetServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListAnnotationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAnnotationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2622,11 +2652,12 @@ describe('v1beta1.DatasetServiceClient', () => { ).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 + assert( + (client.descriptors.page.listAnnotations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3101,12 +3132,15 @@ describe('v1beta1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3137,12 +3171,15 @@ describe('v1beta1.DatasetServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_deployment_resource_pool_service_v1beta1.ts b/test/gapic_deployment_resource_pool_service_v1beta1.ts index 37cde198..70497bd1 100644 --- a/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ b/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -286,15 +301,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() ); @@ -302,11 +314,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getDeploymentResourcePool(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDeploymentResourcePool without error using callback', async () => { @@ -321,15 +336,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() ); @@ -352,11 +364,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDeploymentResourcePool with error', async () => { @@ -371,15 +386,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall( undefined, @@ -389,11 +401,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { client.getDeploymentResourcePool(request), expectedError ); - assert( - (client.innerApiCalls.getDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDeploymentResourcePool with closed client', async () => { @@ -408,7 +423,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDeploymentResourcePoolRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -431,15 +450,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateDeploymentResourcePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -448,11 +464,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const [operation] = await client.createDeploymentResourcePool(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDeploymentResourcePool without error using callback', async () => { @@ -467,15 +486,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateDeploymentResourcePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -505,11 +521,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDeploymentResourcePool with call error', async () => { @@ -524,15 +543,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateDeploymentResourcePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -542,11 +558,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { client.createDeploymentResourcePool(request), expectedError ); - assert( - (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDeploymentResourcePool with LRO error', async () => { @@ -561,15 +580,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateDeploymentResourcePoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -578,11 +594,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ); const [operation] = await client.createDeploymentResourcePool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateDeploymentResourcePoolProgress without error', async () => { @@ -647,15 +666,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -664,11 +680,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const [operation] = await client.deleteDeploymentResourcePool(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDeploymentResourcePool without error using callback', async () => { @@ -683,15 +702,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -721,11 +737,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDeploymentResourcePool with call error', async () => { @@ -740,15 +759,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -758,11 +774,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { client.deleteDeploymentResourcePool(request), expectedError ); - assert( - (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDeploymentResourcePool with LRO error', async () => { @@ -777,15 +796,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteDeploymentResourcePoolRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteDeploymentResourcePoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -794,11 +810,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ); const [operation] = await client.deleteDeploymentResourcePool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteDeploymentResourcePool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDeploymentResourcePool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteDeploymentResourcePoolProgress without error', async () => { @@ -863,15 +882,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -887,11 +903,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listDeploymentResourcePools(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDeploymentResourcePools without error using callback', async () => { @@ -906,15 +925,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -947,11 +963,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDeploymentResourcePools with error', async () => { @@ -966,15 +985,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall( undefined, @@ -984,11 +1000,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { client.listDeploymentResourcePools(request), expectedError ); - assert( - (client.innerApiCalls.listDeploymentResourcePools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDeploymentResourcePools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDeploymentResourcePoolsStream without error', async () => { @@ -1003,8 +1022,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1047,12 +1070,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listDeploymentResourcePools, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listDeploymentResourcePools .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1068,8 +1094,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1101,12 +1131,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listDeploymentResourcePools, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listDeploymentResourcePools .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1122,8 +1155,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1151,12 +1188,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listDeploymentResourcePools .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1172,8 +1212,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDeploymentResourcePoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListDeploymentResourcePoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1192,12 +1236,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listDeploymentResourcePools .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1215,15 +1262,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1239,11 +1282,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryDeployedModels(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryDeployedModels without error using callback', async () => { @@ -1258,15 +1304,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1299,11 +1341,14 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryDeployedModels with error', async () => { @@ -1318,26 +1363,25 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryDeployedModels = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.queryDeployedModels(request), expectedError); - assert( - (client.innerApiCalls.queryDeployedModels as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDeployedModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryDeployedModelsStream without error', async () => { @@ -1352,8 +1396,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1391,11 +1438,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.queryDeployedModels, request) ); - assert.strictEqual( - ( - client.descriptors.page.queryDeployedModels.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.queryDeployedModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1411,8 +1459,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1439,11 +1490,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.queryDeployedModels, request) ); - assert.strictEqual( - ( - client.descriptors.page.queryDeployedModels.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.queryDeployedModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1459,8 +1511,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1487,11 +1542,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1507,8 +1563,11 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryDeployedModelsRequest() ); - request.deploymentResourcePool = ''; - const expectedHeaderRequestParams = 'deployment_resource_pool='; + const defaultValue1 = getTypeDefaultValue('QueryDeployedModelsRequest', [ + 'deploymentResourcePool', + ]); + request.deploymentResourcePool = defaultValue1; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1526,11 +1585,12 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.queryDeployedModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2044,12 +2104,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2083,12 +2146,15 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_endpoint_service_v1.ts b/test/gapic_endpoint_service_v1.ts index 83714891..b53617ab 100644 --- a/test/gapic_endpoint_service_v1.ts +++ b/test/gapic_endpoint_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -322,11 +328,14 @@ describe('v1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint with error', async () => { @@ -338,26 +347,23 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint with closed client', async () => { @@ -369,7 +375,8 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetEndpointRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getEndpoint(request), expectedError); @@ -386,27 +393,27 @@ describe('v1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint without error using callback', async () => { @@ -418,16 +425,13 @@ describe('v1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -450,11 +454,14 @@ describe('v1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint with error', async () => { @@ -466,27 +473,27 @@ describe('v1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint with closed client', async () => { @@ -498,8 +505,12 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateEndpointRequest() ); - request.endpoint = {}; - request.endpoint.name = ''; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateEndpoint(request), expectedError); @@ -516,15 +527,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -533,11 +540,14 @@ describe('v1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint without error using callback', async () => { @@ -549,15 +559,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -587,11 +593,14 @@ describe('v1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint with call error', async () => { @@ -603,26 +612,25 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint with LRO error', async () => { @@ -634,15 +642,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -651,11 +655,14 @@ describe('v1.EndpointServiceClient', () => { ); const [operation] = await client.createEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateEndpointProgress without error', async () => { @@ -710,15 +717,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -727,11 +730,14 @@ describe('v1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint without error using callback', async () => { @@ -743,15 +749,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -781,11 +783,14 @@ describe('v1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint with call error', async () => { @@ -797,26 +802,25 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint with LRO error', async () => { @@ -828,15 +832,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -845,11 +845,14 @@ describe('v1.EndpointServiceClient', () => { ); const [operation] = await client.deleteEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteEndpointProgress without error', async () => { @@ -904,15 +907,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -920,11 +919,14 @@ describe('v1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel without error using callback', async () => { @@ -936,15 +938,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -974,11 +972,14 @@ describe('v1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel with call error', async () => { @@ -990,26 +991,25 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel with LRO error', async () => { @@ -1021,15 +1021,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1038,11 +1034,14 @@ describe('v1.EndpointServiceClient', () => { ); const [operation] = await client.deployModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeployModelProgress without error', async () => { @@ -1094,15 +1093,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1111,11 +1106,14 @@ describe('v1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel without error using callback', async () => { @@ -1127,15 +1125,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1165,11 +1159,14 @@ describe('v1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel with call error', async () => { @@ -1181,26 +1178,25 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel with LRO error', async () => { @@ -1212,15 +1208,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1229,11 +1221,14 @@ describe('v1.EndpointServiceClient', () => { ); const [operation] = await client.undeployModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUndeployModelProgress without error', async () => { @@ -1288,15 +1283,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1305,11 +1296,14 @@ describe('v1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpoints without error using callback', async () => { @@ -1321,15 +1315,11 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1354,11 +1344,14 @@ describe('v1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpoints with error', async () => { @@ -1370,26 +1363,25 @@ describe('v1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpointsStream without error', async () => { @@ -1401,8 +1393,11 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1433,11 +1428,12 @@ describe('v1.EndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1450,8 +1446,11 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1477,11 +1476,12 @@ describe('v1.EndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1494,8 +1494,11 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1515,11 +1518,12 @@ describe('v1.EndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1532,8 +1536,11 @@ describe('v1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1550,11 +1557,12 @@ describe('v1.EndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2029,12 +2037,15 @@ describe('v1.EndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2065,12 +2076,15 @@ describe('v1.EndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_endpoint_service_v1beta1.ts b/test/gapic_endpoint_service_v1beta1.ts index e93606d2..35494492 100644 --- a/test/gapic_endpoint_service_v1beta1.ts +++ b/test/gapic_endpoint_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -322,11 +328,14 @@ describe('v1beta1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint with error', async () => { @@ -338,26 +347,23 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEndpoint with closed client', async () => { @@ -369,7 +375,8 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetEndpointRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetEndpointRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getEndpoint(request), expectedError); @@ -386,27 +393,27 @@ describe('v1beta1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint without error using callback', async () => { @@ -418,16 +425,13 @@ describe('v1beta1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -450,11 +454,14 @@ describe('v1beta1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint with error', async () => { @@ -466,27 +473,27 @@ describe('v1beta1.EndpointServiceClient', () => { 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, - }, - }, - }; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEndpoint with closed client', async () => { @@ -498,8 +505,12 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateEndpointRequest() ); - request.endpoint = {}; - request.endpoint.name = ''; + request.endpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEndpointRequest', [ + 'endpoint', + 'name', + ]); + request.endpoint.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateEndpoint(request), expectedError); @@ -516,15 +527,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -533,11 +540,14 @@ describe('v1beta1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint without error using callback', async () => { @@ -549,15 +559,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -587,11 +593,14 @@ describe('v1beta1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint with call error', async () => { @@ -603,26 +612,25 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEndpoint with LRO error', async () => { @@ -634,15 +642,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -651,11 +655,14 @@ describe('v1beta1.EndpointServiceClient', () => { ); const [operation] = await client.createEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateEndpointProgress without error', async () => { @@ -710,15 +717,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -727,11 +730,14 @@ describe('v1beta1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint without error using callback', async () => { @@ -743,15 +749,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -781,11 +783,14 @@ describe('v1beta1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint with call error', async () => { @@ -797,26 +802,25 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEndpoint with LRO error', async () => { @@ -828,15 +832,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -845,11 +845,14 @@ describe('v1beta1.EndpointServiceClient', () => { ); const [operation] = await client.deleteEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteEndpointProgress without error', async () => { @@ -904,15 +907,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -920,11 +919,14 @@ describe('v1beta1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel without error using callback', async () => { @@ -936,15 +938,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -974,11 +972,14 @@ describe('v1beta1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel with call error', async () => { @@ -990,26 +991,25 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployModel with LRO error', async () => { @@ -1021,15 +1021,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1038,11 +1034,14 @@ describe('v1beta1.EndpointServiceClient', () => { ); const [operation] = await client.deployModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeployModelProgress without error', async () => { @@ -1094,15 +1093,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1111,11 +1106,14 @@ describe('v1beta1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel without error using callback', async () => { @@ -1127,15 +1125,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1165,11 +1159,14 @@ describe('v1beta1.EndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel with call error', async () => { @@ -1181,26 +1178,25 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployModel with LRO error', async () => { @@ -1212,15 +1208,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployModelRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1229,11 +1221,14 @@ describe('v1beta1.EndpointServiceClient', () => { ); const [operation] = await client.undeployModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.undeployModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUndeployModelProgress without error', async () => { @@ -1288,15 +1283,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1311,11 +1302,14 @@ describe('v1beta1.EndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpoints without error using callback', async () => { @@ -1327,15 +1321,11 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1366,11 +1356,14 @@ describe('v1beta1.EndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpoints with error', async () => { @@ -1382,26 +1375,25 @@ describe('v1beta1.EndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEndpointsStream without error', async () => { @@ -1413,8 +1405,11 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1451,11 +1446,12 @@ describe('v1beta1.EndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1468,8 +1464,11 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1495,11 +1494,12 @@ describe('v1beta1.EndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1512,8 +1512,11 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1539,11 +1542,12 @@ describe('v1beta1.EndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1556,8 +1560,11 @@ describe('v1beta1.EndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1575,11 +1582,12 @@ describe('v1beta1.EndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2054,12 +2062,15 @@ describe('v1beta1.EndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2090,12 +2101,15 @@ describe('v1beta1.EndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_featurestore_online_serving_service_v1.ts b/test/gapic_featurestore_online_serving_service_v1.ts index db6bd0a8..2cb68898 100644 --- a/test/gapic_featurestore_online_serving_service_v1.ts +++ b/test/gapic_featurestore_online_serving_service_v1.ts @@ -32,6 +32,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -242,26 +257,25 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues without error using callback', async () => { @@ -276,15 +290,11 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -307,11 +317,14 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues with error', async () => { @@ -326,26 +339,25 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues with closed client', async () => { @@ -360,7 +372,10 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesRequest() ); - request.entityType = ''; + const defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.readFeatureValues(request), expectedError); @@ -380,15 +395,12 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -410,11 +422,14 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes streamingReadFeatureValues with error', async () => { @@ -429,15 +444,12 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall( undefined, @@ -458,11 +470,14 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes streamingReadFeatureValues with closed client', async () => { @@ -477,7 +492,11 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.StreamingReadFeatureValuesRequest() ); - request.entityType = ''; + const defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.streamingReadFeatureValues(request); @@ -1007,12 +1026,15 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1046,12 +1068,15 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_featurestore_online_serving_service_v1beta1.ts b/test/gapic_featurestore_online_serving_service_v1beta1.ts index 55d2875f..f54d0166 100644 --- a/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ b/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -32,6 +32,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -242,26 +257,25 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues without error using callback', async () => { @@ -276,15 +290,11 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -307,11 +317,14 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues with error', async () => { @@ -326,26 +339,25 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readFeatureValues with closed client', async () => { @@ -360,7 +372,10 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest() ); - request.entityType = ''; + const defaultValue1 = getTypeDefaultValue('ReadFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.readFeatureValues(request), expectedError); @@ -380,15 +395,11 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest() ); - request.entityType = ''; - const expectedHeaderRequestParams = 'entity_type='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('WriteFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() ); @@ -396,11 +407,14 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.writeFeatureValues(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeFeatureValues without error using callback', async () => { @@ -415,15 +429,11 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest() ); - request.entityType = ''; - const expectedHeaderRequestParams = 'entity_type='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('WriteFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() ); @@ -446,11 +456,14 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeFeatureValues with error', async () => { @@ -465,26 +478,25 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest() ); - request.entityType = ''; - const expectedHeaderRequestParams = 'entity_type='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('WriteFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.writeFeatureValues = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.writeFeatureValues(request), expectedError); - assert( - (client.innerApiCalls.writeFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeFeatureValues with closed client', async () => { @@ -499,7 +511,10 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest() ); - request.entityType = ''; + const defaultValue1 = getTypeDefaultValue('WriteFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.writeFeatureValues(request), expectedError); @@ -519,15 +534,12 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -549,11 +561,14 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes streamingReadFeatureValues with error', async () => { @@ -568,15 +583,12 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall( undefined, @@ -597,11 +609,14 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.streamingReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamingReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes streamingReadFeatureValues with closed client', async () => { @@ -616,7 +631,11 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest() ); - request.entityType = ''; + const defaultValue1 = getTypeDefaultValue( + 'StreamingReadFeatureValuesRequest', + ['entityType'] + ); + request.entityType = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.streamingReadFeatureValues(request); @@ -1146,12 +1165,15 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1185,12 +1207,15 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_featurestore_service_v1.ts b/test/gapic_featurestore_service_v1.ts index fbeaee26..052b391d 100644 --- a/test/gapic_featurestore_service_v1.ts +++ b/test/gapic_featurestore_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -275,26 +290,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore without error using callback', async () => { @@ -308,15 +322,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() ); @@ -339,11 +349,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore with error', async () => { @@ -357,26 +370,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore with closed client', async () => { @@ -390,7 +402,10 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetFeaturestoreRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeaturestore(request), expectedError); @@ -409,26 +424,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType without error using callback', async () => { @@ -442,15 +456,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -473,11 +483,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType with error', async () => { @@ -491,26 +504,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType with closed client', async () => { @@ -524,7 +536,10 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetEntityTypeRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getEntityType(request), expectedError); @@ -543,27 +558,27 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType without error using callback', async () => { @@ -577,16 +592,13 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -609,11 +621,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType with error', async () => { @@ -627,27 +642,27 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType with closed client', async () => { @@ -661,8 +676,12 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateEntityTypeRequest() ); - request.entityType = {}; - request.entityType.name = ''; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateEntityType(request), expectedError); @@ -681,26 +700,23 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature without error using callback', async () => { @@ -714,15 +730,9 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -745,11 +755,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature with error', async () => { @@ -763,26 +776,23 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature with closed client', async () => { @@ -796,7 +806,8 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetFeatureRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeature(request), expectedError); @@ -815,27 +826,27 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature without error using callback', async () => { @@ -849,16 +860,13 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -881,11 +889,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature with error', async () => { @@ -899,27 +910,27 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature with closed client', async () => { @@ -933,8 +944,12 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateFeatureRequest() ); - request.feature = {}; - request.feature.name = ''; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeature(request), expectedError); @@ -953,15 +968,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -970,11 +981,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore without error using callback', async () => { @@ -988,15 +1002,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1026,11 +1036,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore with call error', async () => { @@ -1044,26 +1057,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore with LRO error', async () => { @@ -1077,15 +1089,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1094,11 +1102,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateFeaturestoreProgress without error', async () => { @@ -1159,16 +1170,13 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1177,11 +1185,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore without error using callback', async () => { @@ -1195,16 +1206,13 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1234,11 +1242,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore with call error', async () => { @@ -1252,27 +1263,27 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore with LRO error', async () => { @@ -1286,16 +1297,13 @@ describe('v1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1304,11 +1312,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.updateFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateFeaturestoreProgress without error', async () => { @@ -1369,15 +1380,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1386,11 +1393,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore without error using callback', async () => { @@ -1404,15 +1414,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1442,11 +1448,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore with call error', async () => { @@ -1460,26 +1469,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore with LRO error', async () => { @@ -1493,15 +1501,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1510,11 +1514,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteFeaturestoreProgress without error', async () => { @@ -1575,15 +1582,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1592,11 +1595,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType without error using callback', async () => { @@ -1610,15 +1616,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1648,11 +1650,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType with call error', async () => { @@ -1666,26 +1671,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType with LRO error', async () => { @@ -1699,15 +1703,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1716,11 +1716,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createEntityType(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateEntityTypeProgress without error', async () => { @@ -1781,15 +1784,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1798,11 +1797,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType without error using callback', async () => { @@ -1816,15 +1818,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1854,11 +1852,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType with call error', async () => { @@ -1872,26 +1873,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType with LRO error', async () => { @@ -1905,15 +1905,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -1922,11 +1918,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteEntityType(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteEntityTypeProgress without error', async () => { @@ -1987,15 +1986,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2004,11 +1999,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature without error using callback', async () => { @@ -2022,15 +2020,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2060,11 +2054,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature with call error', async () => { @@ -2078,26 +2075,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature with LRO error', async () => { @@ -2111,15 +2107,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2128,11 +2120,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createFeature(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateFeatureProgress without error', async () => { @@ -2193,15 +2188,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2210,11 +2201,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures without error using callback', async () => { @@ -2228,15 +2222,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2266,11 +2256,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures with call error', async () => { @@ -2284,26 +2277,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures with LRO error', async () => { @@ -2317,15 +2309,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2334,11 +2322,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.batchCreateFeatures(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchCreateFeaturesProgress without error', async () => { @@ -2399,15 +2390,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2416,11 +2403,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature without error using callback', async () => { @@ -2434,15 +2424,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2472,11 +2458,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature with call error', async () => { @@ -2490,26 +2479,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature with LRO error', async () => { @@ -2523,15 +2511,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2540,11 +2524,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteFeature(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteFeatureProgress without error', async () => { @@ -2605,15 +2592,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2622,11 +2605,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues without error using callback', async () => { @@ -2640,15 +2626,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2678,11 +2660,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues with call error', async () => { @@ -2696,26 +2681,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues with LRO error', async () => { @@ -2729,15 +2713,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2746,11 +2726,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.importFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkImportFeatureValuesProgress without error', async () => { @@ -2811,15 +2794,12 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2828,11 +2808,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues without error using callback', async () => { @@ -2846,15 +2829,12 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2884,11 +2864,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues with call error', async () => { @@ -2902,15 +2885,12 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -2920,11 +2900,14 @@ describe('v1.FeaturestoreServiceClient', () => { client.batchReadFeatureValues(request), expectedError ); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues with LRO error', async () => { @@ -2938,15 +2921,12 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -2955,11 +2935,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.batchReadFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchReadFeatureValuesProgress without error', async () => { @@ -3014,21 +2997,17 @@ describe('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, - }, - }, - }; + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ExportFeatureValuesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3037,11 +3016,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues without error using callback', async () => { @@ -3055,15 +3037,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3093,11 +3071,14 @@ describe('v1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues with call error', async () => { @@ -3111,26 +3092,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues with LRO error', async () => { @@ -3144,15 +3124,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3161,11 +3137,14 @@ describe('v1.FeaturestoreServiceClient', () => { ); const [operation] = await client.exportFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportFeatureValuesProgress without error', async () => { @@ -3226,15 +3205,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3249,11 +3224,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestores without error using callback', async () => { @@ -3267,15 +3245,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3306,11 +3280,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestores with error', async () => { @@ -3324,26 +3301,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestoresStream without error', async () => { @@ -3357,8 +3333,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3395,11 +3374,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3414,8 +3394,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3441,11 +3424,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3460,8 +3444,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3487,11 +3474,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3506,8 +3494,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3524,11 +3515,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3545,15 +3537,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3568,11 +3556,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypes without error using callback', async () => { @@ -3586,15 +3577,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3625,11 +3612,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypes with error', async () => { @@ -3643,26 +3633,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypesStream without error', async () => { @@ -3676,8 +3665,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3714,11 +3706,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3733,8 +3726,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3760,11 +3756,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3779,8 +3776,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3806,11 +3806,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3825,8 +3826,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3843,11 +3847,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3864,15 +3869,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -3881,11 +3882,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeatures without error using callback', async () => { @@ -3899,15 +3903,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -3932,11 +3932,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeatures with error', async () => { @@ -3950,26 +3953,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturesStream without error', async () => { @@ -3983,8 +3985,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4015,11 +4020,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4034,8 +4040,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -4063,11 +4072,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4082,8 +4092,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4103,11 +4116,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4122,8 +4136,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4140,11 +4157,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4161,15 +4179,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4178,11 +4192,14 @@ describe('v1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeatures without error using callback', async () => { @@ -4196,15 +4213,11 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4229,11 +4242,14 @@ describe('v1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeatures with error', async () => { @@ -4247,26 +4263,25 @@ describe('v1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeaturesStream without error', async () => { @@ -4280,8 +4295,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4312,11 +4330,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4331,8 +4350,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4358,11 +4380,12 @@ describe('v1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4377,8 +4400,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4398,11 +4424,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4417,8 +4444,11 @@ describe('v1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4435,11 +4465,12 @@ describe('v1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4940,12 +4971,15 @@ describe('v1.FeaturestoreServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -4978,12 +5012,15 @@ describe('v1.FeaturestoreServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_featurestore_service_v1beta1.ts b/test/gapic_featurestore_service_v1beta1.ts index 8750ce16..b7a070f1 100644 --- a/test/gapic_featurestore_service_v1beta1.ts +++ b/test/gapic_featurestore_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -269,26 +284,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore without error using callback', async () => { @@ -301,15 +315,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() ); @@ -332,11 +342,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore with error', async () => { @@ -349,26 +362,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeaturestore with closed client', async () => { @@ -381,7 +393,10 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetFeaturestoreRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeaturestore(request), expectedError); @@ -399,26 +414,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType without error using callback', async () => { @@ -431,15 +445,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -462,11 +472,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType with error', async () => { @@ -479,26 +492,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getEntityType with closed client', async () => { @@ -511,7 +523,10 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetEntityTypeRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getEntityType(request), expectedError); @@ -529,27 +544,27 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType without error using callback', async () => { @@ -562,16 +577,13 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -594,11 +606,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType with error', async () => { @@ -611,27 +626,27 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateEntityType with closed client', async () => { @@ -644,8 +659,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateEntityTypeRequest() ); - request.entityType = {}; - request.entityType.name = ''; + request.entityType ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateEntityTypeRequest', [ + 'entityType', + 'name', + ]); + request.entityType.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateEntityType(request), expectedError); @@ -663,26 +682,23 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature without error using callback', async () => { @@ -695,15 +711,9 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -726,11 +736,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature with error', async () => { @@ -743,26 +756,23 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getFeature with closed client', async () => { @@ -775,7 +785,8 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetFeatureRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetFeatureRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getFeature(request), expectedError); @@ -793,27 +804,27 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature without error using callback', async () => { @@ -826,16 +837,13 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -858,11 +866,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature with error', async () => { @@ -875,27 +886,27 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; + const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeature with closed client', async () => { @@ -908,8 +919,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureRequest() ); - request.feature = {}; - request.feature.name = ''; + request.feature ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeatureRequest', [ + 'feature', + 'name', + ]); + request.feature.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateFeature(request), expectedError); @@ -927,15 +942,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -944,11 +955,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore without error using callback', async () => { @@ -961,15 +975,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -999,11 +1009,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore with call error', async () => { @@ -1016,26 +1029,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeaturestore with LRO error', async () => { @@ -1048,15 +1060,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeaturestoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1065,11 +1073,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateFeaturestoreProgress without error', async () => { @@ -1127,16 +1138,13 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1145,11 +1153,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore without error using callback', async () => { @@ -1162,16 +1173,13 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1201,11 +1209,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore with call error', async () => { @@ -1218,27 +1229,27 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateFeaturestore with LRO error', async () => { @@ -1251,16 +1262,13 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + request.featurestore ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateFeaturestoreRequest', [ + 'featurestore', + 'name', + ]); + request.featurestore.name = defaultValue1; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1269,11 +1277,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.updateFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateFeaturestoreProgress without error', async () => { @@ -1331,15 +1342,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1348,11 +1355,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore without error using callback', async () => { @@ -1365,15 +1375,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1403,11 +1409,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore with call error', async () => { @@ -1420,26 +1429,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeaturestore with LRO error', async () => { @@ -1452,15 +1460,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeaturestoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1469,11 +1473,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteFeaturestore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteFeaturestore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeaturestore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteFeaturestoreProgress without error', async () => { @@ -1531,15 +1538,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1548,11 +1551,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType without error using callback', async () => { @@ -1565,15 +1571,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1603,11 +1605,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType with call error', async () => { @@ -1620,26 +1625,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createEntityType with LRO error', async () => { @@ -1652,15 +1656,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateEntityTypeRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1669,11 +1669,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createEntityType(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateEntityTypeProgress without error', async () => { @@ -1731,15 +1734,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1748,11 +1747,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType without error using callback', async () => { @@ -1765,15 +1767,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1803,11 +1801,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType with call error', async () => { @@ -1820,26 +1821,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteEntityType with LRO error', async () => { @@ -1852,15 +1852,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteEntityTypeRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -1869,11 +1865,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteEntityType(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteEntityType as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteEntityType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteEntityTypeProgress without error', async () => { @@ -1931,15 +1930,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1948,11 +1943,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature without error using callback', async () => { @@ -1965,15 +1963,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2003,11 +1997,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature with call error', async () => { @@ -2020,26 +2017,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createFeature with LRO error', async () => { @@ -2052,15 +2048,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateFeatureRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2069,11 +2061,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.createFeature(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateFeatureProgress without error', async () => { @@ -2131,15 +2126,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2148,11 +2139,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures without error using callback', async () => { @@ -2165,15 +2159,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2203,11 +2193,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures with call error', async () => { @@ -2220,26 +2213,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateFeatures with LRO error', async () => { @@ -2252,15 +2244,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('BatchCreateFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2269,11 +2257,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.batchCreateFeatures(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchCreateFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchCreateFeaturesProgress without error', async () => { @@ -2331,15 +2322,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2348,11 +2335,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature without error using callback', async () => { @@ -2365,15 +2355,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2403,11 +2389,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature with call error', async () => { @@ -2420,26 +2409,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteFeature with LRO error', async () => { @@ -2452,15 +2440,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteFeatureRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2469,11 +2453,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.deleteFeature(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteFeature as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFeature as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteFeatureProgress without error', async () => { @@ -2531,15 +2518,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2548,11 +2531,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues without error using callback', async () => { @@ -2565,15 +2551,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2603,11 +2585,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues with call error', async () => { @@ -2620,26 +2605,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importFeatureValues with LRO error', async () => { @@ -2652,15 +2636,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ImportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2669,11 +2649,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.importFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.importFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkImportFeatureValuesProgress without error', async () => { @@ -2731,15 +2714,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2748,11 +2728,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues without error using callback', async () => { @@ -2765,15 +2748,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2803,11 +2783,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues with call error', async () => { @@ -2820,15 +2803,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -2838,11 +2818,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { client.batchReadFeatureValues(request), expectedError ); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadFeatureValues with LRO error', async () => { @@ -2855,15 +2838,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadFeatureValuesRequest', + ['featurestore'] + ); + request.featurestore = defaultValue1; + const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -2872,11 +2852,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.batchReadFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchReadFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchReadFeatureValuesProgress without error', async () => { @@ -2928,21 +2911,17 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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, - }, - }, - }; + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ExportFeatureValuesRequest() + ); + const defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2951,11 +2930,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues without error using callback', async () => { @@ -2968,15 +2950,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3006,11 +2984,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues with call error', async () => { @@ -3023,26 +3004,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportFeatureValues with LRO error', async () => { @@ -3055,15 +3035,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportFeatureValuesRequest', [ + 'entityType', + ]); + request.entityType = defaultValue1; + const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3072,11 +3048,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ); const [operation] = await client.exportFeatureValues(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportFeatureValues as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportFeatureValues as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportFeatureValuesProgress without error', async () => { @@ -3134,15 +3113,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3157,11 +3132,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestores without error using callback', async () => { @@ -3174,15 +3152,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3215,11 +3189,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeaturestores as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestores with error', async () => { @@ -3232,26 +3209,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeaturestores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturestoresStream without error', async () => { @@ -3264,8 +3240,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3303,11 +3282,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3321,8 +3301,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3349,11 +3332,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeaturestores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3367,8 +3351,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3395,11 +3382,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3413,8 +3401,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturestoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturestoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3432,11 +3423,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeaturestores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3452,15 +3444,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3475,11 +3463,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypes without error using callback', async () => { @@ -3492,15 +3483,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3531,11 +3518,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listEntityTypes as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypes with error', async () => { @@ -3548,26 +3538,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listEntityTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listEntityTypesStream without error', async () => { @@ -3580,8 +3569,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3619,11 +3611,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3637,8 +3630,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3665,11 +3661,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listEntityTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3683,8 +3680,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3711,11 +3711,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3729,8 +3730,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListEntityTypesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListEntityTypesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3748,11 +3752,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listEntityTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3768,15 +3773,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3791,11 +3792,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeatures without error using callback', async () => { @@ -3808,15 +3812,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3847,11 +3847,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeatures with error', async () => { @@ -3864,26 +3867,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listFeaturesStream without error', async () => { @@ -3896,8 +3898,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3934,11 +3939,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3952,8 +3958,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -3981,11 +3990,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.listFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3999,8 +4009,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4026,11 +4039,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4044,8 +4058,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListFeaturesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListFeaturesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4062,11 +4079,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.listFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4082,15 +4100,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4105,11 +4119,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeatures without error using callback', async () => { @@ -4122,15 +4139,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4161,11 +4174,14 @@ describe('v1beta1.FeaturestoreServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchFeatures as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeatures with error', async () => { @@ -4178,26 +4194,25 @@ describe('v1beta1.FeaturestoreServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchFeatures as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchFeaturesStream without error', async () => { @@ -4210,8 +4225,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4248,11 +4266,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4266,8 +4285,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4293,11 +4315,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { .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 + assert( + (client.descriptors.page.searchFeatures.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4311,8 +4334,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4338,11 +4364,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4356,8 +4383,11 @@ describe('v1beta1.FeaturestoreServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchFeaturesRequest() ); - request.location = ''; - const expectedHeaderRequestParams = 'location='; + const defaultValue1 = getTypeDefaultValue('SearchFeaturesRequest', [ + 'location', + ]); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4374,11 +4404,12 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).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 + assert( + (client.descriptors.page.searchFeatures.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4866,12 +4897,15 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -4903,12 +4937,15 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_index_endpoint_service_v1.ts b/test/gapic_index_endpoint_service_v1.ts index dfb97c58..dd41ce5d 100644 --- a/test/gapic_index_endpoint_service_v1.ts +++ b/test/gapic_index_endpoint_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -269,26 +284,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint without error using callback', async () => { @@ -301,15 +315,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -332,11 +342,14 @@ describe('v1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint with error', async () => { @@ -349,26 +362,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint with closed client', async () => { @@ -381,7 +393,10 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetIndexEndpointRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIndexEndpoint(request), expectedError); @@ -399,16 +414,13 @@ describe('v1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -416,11 +428,14 @@ describe('v1.IndexEndpointServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateIndexEndpoint(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint without error using callback', async () => { @@ -433,16 +448,13 @@ describe('v1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -465,11 +477,14 @@ describe('v1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint with error', async () => { @@ -482,27 +497,27 @@ describe('v1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint with closed client', async () => { @@ -515,8 +530,12 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateIndexEndpointRequest() ); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateIndexEndpoint(request), expectedError); @@ -534,15 +553,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -551,11 +566,14 @@ describe('v1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint without error using callback', async () => { @@ -568,15 +586,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -606,11 +620,14 @@ describe('v1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint with call error', async () => { @@ -623,26 +640,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint with LRO error', async () => { @@ -655,15 +671,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -672,11 +684,14 @@ describe('v1.IndexEndpointServiceClient', () => { ); const [operation] = await client.createIndexEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateIndexEndpointProgress without error', async () => { @@ -734,15 +749,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -751,11 +762,14 @@ describe('v1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint without error using callback', async () => { @@ -768,15 +782,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -806,11 +816,14 @@ describe('v1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint with call error', async () => { @@ -823,26 +836,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint with LRO error', async () => { @@ -855,15 +867,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -872,11 +880,14 @@ describe('v1.IndexEndpointServiceClient', () => { ); const [operation] = await client.deleteIndexEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteIndexEndpointProgress without error', async () => { @@ -934,15 +945,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -950,11 +957,14 @@ describe('v1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex without error using callback', async () => { @@ -967,15 +977,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1005,11 +1011,14 @@ describe('v1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex with call error', async () => { @@ -1022,26 +1031,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex with LRO error', async () => { @@ -1054,15 +1062,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1071,11 +1075,14 @@ describe('v1.IndexEndpointServiceClient', () => { ); const [operation] = await client.deployIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeployIndexProgress without error', async () => { @@ -1130,15 +1137,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1147,11 +1150,14 @@ describe('v1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex without error using callback', async () => { @@ -1164,15 +1170,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1202,11 +1204,14 @@ describe('v1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex with call error', async () => { @@ -1219,26 +1224,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex with LRO error', async () => { @@ -1251,15 +1255,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1268,11 +1268,14 @@ describe('v1.IndexEndpointServiceClient', () => { ); const [operation] = await client.undeployIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUndeployIndexProgress without error', async () => { @@ -1330,15 +1333,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1347,11 +1346,14 @@ describe('v1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex without error using callback', async () => { @@ -1364,15 +1366,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1402,11 +1400,14 @@ describe('v1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex with call error', async () => { @@ -1419,26 +1420,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex with LRO error', async () => { @@ -1451,15 +1451,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1468,11 +1464,14 @@ describe('v1.IndexEndpointServiceClient', () => { ); const [operation] = await client.mutateDeployedIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkMutateDeployedIndexProgress without error', async () => { @@ -1530,15 +1529,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1554,11 +1549,14 @@ describe('v1.IndexEndpointServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listIndexEndpoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpoints without error using callback', async () => { @@ -1571,15 +1569,11 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1610,11 +1604,14 @@ describe('v1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpoints with error', async () => { @@ -1627,26 +1624,25 @@ describe('v1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpointsStream without error', async () => { @@ -1659,8 +1655,11 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1697,11 +1696,12 @@ describe('v1.IndexEndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1715,8 +1715,11 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1742,11 +1745,12 @@ describe('v1.IndexEndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1760,8 +1764,11 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1787,11 +1794,12 @@ describe('v1.IndexEndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1805,8 +1813,11 @@ describe('v1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1824,11 +1835,12 @@ describe('v1.IndexEndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2316,12 +2328,15 @@ describe('v1.IndexEndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2353,12 +2368,15 @@ describe('v1.IndexEndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_index_endpoint_service_v1beta1.ts b/test/gapic_index_endpoint_service_v1beta1.ts index a9d21de4..1259a433 100644 --- a/test/gapic_index_endpoint_service_v1beta1.ts +++ b/test/gapic_index_endpoint_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -271,26 +286,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint without error using callback', async () => { @@ -303,15 +317,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -334,11 +344,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint with error', async () => { @@ -351,26 +364,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndexEndpoint with closed client', async () => { @@ -383,7 +395,10 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetIndexEndpointRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIndexEndpoint(request), expectedError); @@ -401,16 +416,13 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -418,11 +430,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateIndexEndpoint(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint without error using callback', async () => { @@ -435,16 +450,13 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -467,11 +479,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint with error', async () => { @@ -484,27 +499,27 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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, - }, - }, - }; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndexEndpoint with closed client', async () => { @@ -517,8 +532,12 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateIndexEndpointRequest() ); - request.indexEndpoint = {}; - request.indexEndpoint.name = ''; + request.indexEndpoint ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexEndpointRequest', [ + 'indexEndpoint', + 'name', + ]); + request.indexEndpoint.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateIndexEndpoint(request), expectedError); @@ -536,15 +555,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -553,11 +568,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint without error using callback', async () => { @@ -570,15 +588,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -608,11 +622,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint with call error', async () => { @@ -625,26 +642,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndexEndpoint with LRO error', async () => { @@ -657,15 +673,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexEndpointRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -674,11 +686,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); const [operation] = await client.createIndexEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateIndexEndpointProgress without error', async () => { @@ -736,15 +751,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -753,11 +764,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint without error using callback', async () => { @@ -770,15 +784,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -808,11 +818,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint with call error', async () => { @@ -825,26 +838,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndexEndpoint with LRO error', async () => { @@ -857,15 +869,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexEndpointRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -874,11 +882,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); const [operation] = await client.deleteIndexEndpoint(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteIndexEndpoint as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndexEndpoint as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteIndexEndpointProgress without error', async () => { @@ -936,15 +947,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -952,11 +959,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex without error using callback', async () => { @@ -969,15 +979,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1007,11 +1013,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex with call error', async () => { @@ -1024,26 +1033,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deployIndex with LRO error', async () => { @@ -1056,15 +1064,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1073,11 +1077,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); const [operation] = await client.deployIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeployIndexProgress without error', async () => { @@ -1132,15 +1139,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1149,11 +1152,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex without error using callback', async () => { @@ -1166,15 +1172,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1204,11 +1206,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex with call error', async () => { @@ -1221,26 +1226,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes undeployIndex with LRO error', async () => { @@ -1253,15 +1257,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UndeployIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1270,11 +1270,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); const [operation] = await client.undeployIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.undeployIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeployIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUndeployIndexProgress without error', async () => { @@ -1332,15 +1335,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1349,11 +1348,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex without error using callback', async () => { @@ -1366,15 +1368,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1404,11 +1402,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex with call error', async () => { @@ -1421,26 +1422,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mutateDeployedIndex with LRO error', async () => { @@ -1453,15 +1453,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MutateDeployedIndexRequest', [ + 'indexEndpoint', + ]); + request.indexEndpoint = defaultValue1; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1470,11 +1466,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ); const [operation] = await client.mutateDeployedIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.mutateDeployedIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mutateDeployedIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkMutateDeployedIndexProgress without error', async () => { @@ -1532,15 +1531,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1556,11 +1551,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listIndexEndpoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpoints without error using callback', async () => { @@ -1573,15 +1571,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1614,11 +1608,14 @@ describe('v1beta1.IndexEndpointServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexEndpoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpoints with error', async () => { @@ -1631,26 +1628,25 @@ describe('v1beta1.IndexEndpointServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexEndpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexEndpointsStream without error', async () => { @@ -1663,8 +1659,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1702,11 +1701,12 @@ describe('v1beta1.IndexEndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1720,8 +1720,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1748,11 +1751,12 @@ describe('v1beta1.IndexEndpointServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexEndpoints.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1766,8 +1770,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1794,11 +1801,12 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1812,8 +1820,11 @@ describe('v1beta1.IndexEndpointServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexEndpointsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexEndpointsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1831,11 +1842,12 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ).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 + assert( + (client.descriptors.page.listIndexEndpoints.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2323,12 +2335,15 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2360,12 +2375,15 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_index_service_v1.ts b/test/gapic_index_service_v1.ts index 81061411..19862c4a 100644 --- a/test/gapic_index_service_v1.ts +++ b/test/gapic_index_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -258,26 +273,23 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex without error using callback', async () => { @@ -289,15 +301,9 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Index() ); @@ -320,11 +326,14 @@ describe('v1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex with error', async () => { @@ -336,23 +345,20 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex with closed client', async () => { @@ -364,7 +370,8 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetIndexRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIndex(request), expectedError); @@ -381,26 +388,25 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() ); client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); const [response] = await client.upsertDatapoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints without error using callback', async () => { @@ -412,15 +418,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() ); @@ -443,11 +445,14 @@ describe('v1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints with error', async () => { @@ -459,26 +464,25 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.upsertDatapoints = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.upsertDatapoints(request), expectedError); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints with closed client', async () => { @@ -490,7 +494,10 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsRequest() ); - request.index = ''; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.upsertDatapoints(request), expectedError); @@ -507,26 +514,25 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() ); client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); const [response] = await client.removeDatapoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints without error using callback', async () => { @@ -538,15 +544,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() ); @@ -569,11 +571,14 @@ describe('v1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints with error', async () => { @@ -585,26 +590,25 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.removeDatapoints = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.removeDatapoints(request), expectedError); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints with closed client', async () => { @@ -616,7 +620,10 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsRequest() ); - request.index = ''; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeDatapoints(request), expectedError); @@ -633,15 +640,11 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -649,11 +652,14 @@ describe('v1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex without error using callback', async () => { @@ -665,15 +671,11 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -703,11 +705,14 @@ describe('v1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex with call error', async () => { @@ -719,26 +724,25 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex with LRO error', async () => { @@ -750,15 +754,11 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -767,11 +767,14 @@ describe('v1.IndexServiceClient', () => { ); const [operation] = await client.createIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateIndexProgress without error', async () => { @@ -823,16 +826,13 @@ describe('v1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -840,11 +840,14 @@ describe('v1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex without error using callback', async () => { @@ -856,16 +859,13 @@ describe('v1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -895,11 +895,14 @@ describe('v1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex with call error', async () => { @@ -911,27 +914,27 @@ describe('v1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex with LRO error', async () => { @@ -943,16 +946,13 @@ describe('v1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -961,11 +961,14 @@ describe('v1.IndexServiceClient', () => { ); const [operation] = await client.updateIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateIndexProgress without error', async () => { @@ -1017,15 +1020,9 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1033,11 +1030,14 @@ describe('v1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex without error using callback', async () => { @@ -1049,15 +1049,9 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1087,11 +1081,14 @@ describe('v1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex with call error', async () => { @@ -1103,26 +1100,23 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex with LRO error', async () => { @@ -1134,15 +1128,9 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1151,11 +1139,14 @@ describe('v1.IndexServiceClient', () => { ); const [operation] = await client.deleteIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteIndexProgress without error', async () => { @@ -1207,15 +1198,11 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1224,11 +1211,14 @@ describe('v1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexes without error using callback', async () => { @@ -1240,15 +1230,11 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1273,11 +1259,14 @@ describe('v1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexes with error', async () => { @@ -1289,26 +1278,25 @@ describe('v1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexesStream without error', async () => { @@ -1320,8 +1308,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1352,11 +1343,12 @@ describe('v1.IndexServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1369,8 +1361,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.createStream = stubPageStreamingCall( undefined, @@ -1398,11 +1393,12 @@ describe('v1.IndexServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1415,8 +1411,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1436,11 +1435,12 @@ describe('v1.IndexServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1453,8 +1453,11 @@ describe('v1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall( undefined, @@ -1473,11 +1476,12 @@ describe('v1.IndexServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1952,12 +1956,15 @@ describe('v1.IndexServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1988,12 +1995,15 @@ describe('v1.IndexServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_index_service_v1beta1.ts b/test/gapic_index_service_v1beta1.ts index 51f2de19..61dc66d5 100644 --- a/test/gapic_index_service_v1beta1.ts +++ b/test/gapic_index_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() ); @@ -322,11 +328,14 @@ describe('v1beta1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex with error', async () => { @@ -338,23 +347,20 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getIndex with closed client', async () => { @@ -366,7 +372,8 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetIndexRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetIndexRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getIndex(request), expectedError); @@ -383,26 +390,25 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() ); client.innerApiCalls.upsertDatapoints = stubSimpleCall(expectedResponse); const [response] = await client.upsertDatapoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints without error using callback', async () => { @@ -414,15 +420,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() ); @@ -445,11 +447,14 @@ describe('v1beta1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints with error', async () => { @@ -461,26 +466,25 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.upsertDatapoints = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.upsertDatapoints(request), expectedError); - assert( - (client.innerApiCalls.upsertDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upsertDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upsertDatapoints with closed client', async () => { @@ -492,7 +496,10 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsRequest() ); - request.index = ''; + const defaultValue1 = getTypeDefaultValue('UpsertDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.upsertDatapoints(request), expectedError); @@ -509,26 +516,25 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() ); client.innerApiCalls.removeDatapoints = stubSimpleCall(expectedResponse); const [response] = await client.removeDatapoints(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints without error using callback', async () => { @@ -540,15 +546,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() ); @@ -571,11 +573,14 @@ describe('v1beta1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints with error', async () => { @@ -587,26 +592,25 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest() ); - request.index = ''; - const expectedHeaderRequestParams = 'index='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; + const expectedHeaderRequestParams = `index=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.removeDatapoints = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.removeDatapoints(request), expectedError); - assert( - (client.innerApiCalls.removeDatapoints as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDatapoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDatapoints with closed client', async () => { @@ -618,7 +622,10 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsRequest() ); - request.index = ''; + const defaultValue1 = getTypeDefaultValue('RemoveDatapointsRequest', [ + 'index', + ]); + request.index = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeDatapoints(request), expectedError); @@ -635,15 +642,11 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -651,11 +654,14 @@ describe('v1beta1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex without error using callback', async () => { @@ -667,15 +673,11 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -705,11 +707,14 @@ describe('v1beta1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex with call error', async () => { @@ -721,26 +726,25 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createIndex with LRO error', async () => { @@ -752,15 +756,11 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateIndexRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -769,11 +769,14 @@ describe('v1beta1.IndexServiceClient', () => { ); const [operation] = await client.createIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateIndexProgress without error', async () => { @@ -825,16 +828,13 @@ describe('v1beta1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -842,11 +842,14 @@ describe('v1beta1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex without error using callback', async () => { @@ -858,16 +861,13 @@ describe('v1beta1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -897,11 +897,14 @@ describe('v1beta1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex with call error', async () => { @@ -913,27 +916,27 @@ describe('v1beta1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateIndex with LRO error', async () => { @@ -945,16 +948,13 @@ describe('v1beta1.IndexServiceClient', () => { 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, - }, - }, - }; + request.index ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateIndexRequest', [ + 'index', + 'name', + ]); + request.index.name = defaultValue1; + const expectedHeaderRequestParams = `index.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -963,11 +963,14 @@ describe('v1beta1.IndexServiceClient', () => { ); const [operation] = await client.updateIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateIndexProgress without error', async () => { @@ -1019,15 +1022,9 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1035,11 +1032,14 @@ describe('v1beta1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex without error using callback', async () => { @@ -1051,15 +1051,9 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1089,11 +1083,14 @@ describe('v1beta1.IndexServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex with call error', async () => { @@ -1105,26 +1102,23 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteIndex with LRO error', async () => { @@ -1136,15 +1130,9 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteIndexRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1153,11 +1141,14 @@ describe('v1beta1.IndexServiceClient', () => { ); const [operation] = await client.deleteIndex(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteIndex as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteIndex as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteIndexProgress without error', async () => { @@ -1209,15 +1200,11 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1232,11 +1219,14 @@ describe('v1beta1.IndexServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexes without error using callback', async () => { @@ -1248,15 +1238,11 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1287,11 +1273,14 @@ describe('v1beta1.IndexServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listIndexes as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexes with error', async () => { @@ -1303,26 +1292,25 @@ describe('v1beta1.IndexServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listIndexes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listIndexesStream without error', async () => { @@ -1334,8 +1322,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1372,11 +1363,12 @@ describe('v1beta1.IndexServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1389,8 +1381,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.createStream = stubPageStreamingCall( undefined, @@ -1418,11 +1413,12 @@ describe('v1beta1.IndexServiceClient', () => { .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 + assert( + (client.descriptors.page.listIndexes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1435,8 +1431,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1462,11 +1461,12 @@ describe('v1beta1.IndexServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1479,8 +1479,11 @@ describe('v1beta1.IndexServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListIndexesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListIndexesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall( undefined, @@ -1499,11 +1502,12 @@ describe('v1beta1.IndexServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listIndexes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1978,12 +1982,15 @@ describe('v1beta1.IndexServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2014,12 +2021,15 @@ describe('v1beta1.IndexServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_job_service_v1.ts b/test/gapic_job_service_v1.ts index 84b3a6eb..32bf0cb9 100644 --- a/test/gapic_job_service_v1.ts +++ b/test/gapic_job_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -258,26 +273,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob without error using callback', async () => { @@ -289,15 +303,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -320,11 +330,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob with error', async () => { @@ -336,26 +349,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob with closed client', async () => { @@ -367,7 +379,10 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateCustomJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createCustomJob(request), expectedError); @@ -384,26 +399,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob without error using callback', async () => { @@ -415,15 +429,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -446,11 +456,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob with error', async () => { @@ -462,26 +475,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob with closed client', async () => { @@ -493,7 +505,10 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetCustomJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getCustomJob(request), expectedError); @@ -510,26 +525,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob without error using callback', async () => { @@ -541,15 +555,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -572,11 +582,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob with error', async () => { @@ -588,26 +601,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob with closed client', async () => { @@ -619,7 +631,10 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelCustomJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.cancelCustomJob(request), expectedError); @@ -636,15 +651,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -652,11 +664,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob without error using callback', async () => { @@ -668,15 +683,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -699,11 +711,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob with error', async () => { @@ -715,15 +730,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataLabelingJob = stubSimpleCall( undefined, @@ -733,11 +745,14 @@ describe('v1.JobServiceClient', () => { client.createDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob with closed client', async () => { @@ -749,7 +764,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateDataLabelingJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -769,15 +788,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -785,11 +800,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob without error using callback', async () => { @@ -801,15 +819,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -832,11 +846,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob with error', async () => { @@ -848,26 +865,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob with closed client', async () => { @@ -879,7 +895,10 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetDataLabelingJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getDataLabelingJob(request), expectedError); @@ -896,15 +915,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -912,11 +928,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob without error using callback', async () => { @@ -928,15 +947,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -959,11 +975,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob with error', async () => { @@ -975,15 +994,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall( undefined, @@ -993,11 +1009,14 @@ describe('v1.JobServiceClient', () => { client.cancelDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob with closed client', async () => { @@ -1009,7 +1028,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelDataLabelingJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1029,15 +1052,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1045,11 +1065,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob without error using callback', async () => { @@ -1061,15 +1084,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1092,11 +1112,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob with error', async () => { @@ -1108,15 +1131,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1126,11 +1146,14 @@ describe('v1.JobServiceClient', () => { client.createHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob with closed client', async () => { @@ -1142,7 +1165,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateHyperparameterTuningJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1162,15 +1189,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1178,11 +1202,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob without error using callback', async () => { @@ -1194,15 +1221,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1225,11 +1249,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob with error', async () => { @@ -1241,15 +1268,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1259,11 +1283,14 @@ describe('v1.JobServiceClient', () => { client.getHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob with closed client', async () => { @@ -1275,7 +1302,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetHyperparameterTuningJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1295,15 +1326,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1311,11 +1339,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob without error using callback', async () => { @@ -1327,15 +1358,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1358,11 +1386,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob with error', async () => { @@ -1374,15 +1405,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1392,11 +1420,14 @@ describe('v1.JobServiceClient', () => { client.cancelHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob with closed client', async () => { @@ -1408,7 +1439,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelHyperparameterTuningJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1428,15 +1463,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -1444,11 +1476,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob without error using callback', async () => { @@ -1460,15 +1495,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -1491,11 +1523,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob with error', async () => { @@ -1507,15 +1542,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBatchPredictionJob = stubSimpleCall( undefined, @@ -1525,11 +1557,14 @@ describe('v1.JobServiceClient', () => { client.createBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob with closed client', async () => { @@ -1541,7 +1576,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateBatchPredictionJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1561,15 +1600,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -1577,11 +1613,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob without error using callback', async () => { @@ -1593,15 +1632,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -1624,11 +1660,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob with error', async () => { @@ -1640,15 +1679,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBatchPredictionJob = stubSimpleCall( undefined, @@ -1658,11 +1694,14 @@ describe('v1.JobServiceClient', () => { client.getBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob with closed client', async () => { @@ -1674,7 +1713,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetBatchPredictionJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1694,15 +1737,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1710,11 +1750,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob without error using callback', async () => { @@ -1726,15 +1769,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1757,11 +1797,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob with error', async () => { @@ -1773,15 +1816,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall( undefined, @@ -1791,11 +1831,14 @@ describe('v1.JobServiceClient', () => { client.cancelBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob with closed client', async () => { @@ -1807,7 +1850,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelBatchPredictionJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1827,15 +1874,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -1845,11 +1889,14 @@ describe('v1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { @@ -1861,15 +1908,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -1892,11 +1936,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob with error', async () => { @@ -1908,15 +1955,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -1926,11 +1970,14 @@ describe('v1.JobServiceClient', () => { client.createModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob with closed client', async () => { @@ -1942,7 +1989,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateModelDeploymentMonitoringJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1962,15 +2013,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -1978,11 +2026,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelDeploymentMonitoringJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { @@ -1992,17 +2043,14 @@ describe('v1.JobServiceClient', () => { }); 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, - }, - }, - }; + new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -2025,11 +2073,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob with error', async () => { @@ -2041,15 +2092,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2059,11 +2107,14 @@ describe('v1.JobServiceClient', () => { client.getModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob with closed client', async () => { @@ -2075,7 +2126,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2095,15 +2150,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2113,11 +2165,14 @@ describe('v1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { @@ -2129,15 +2184,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2160,11 +2212,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob with error', async () => { @@ -2176,15 +2231,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2194,11 +2246,14 @@ describe('v1.JobServiceClient', () => { client.pauseModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { @@ -2210,7 +2265,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PauseModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2230,15 +2289,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2248,11 +2304,14 @@ describe('v1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { @@ -2264,15 +2323,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2295,11 +2351,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob with error', async () => { @@ -2311,15 +2370,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2329,11 +2385,14 @@ describe('v1.JobServiceClient', () => { client.resumeModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { @@ -2345,7 +2404,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ResumeModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2365,15 +2428,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2382,11 +2441,14 @@ describe('v1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob without error using callback', async () => { @@ -2398,15 +2460,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2436,11 +2494,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob with call error', async () => { @@ -2452,26 +2513,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob with LRO error', async () => { @@ -2483,15 +2543,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -2500,11 +2556,14 @@ describe('v1.JobServiceClient', () => { ); const [operation] = await client.deleteCustomJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteCustomJobProgress without error', async () => { @@ -2559,15 +2618,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2576,11 +2632,14 @@ describe('v1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob without error using callback', async () => { @@ -2592,15 +2651,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2630,11 +2686,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob with call error', async () => { @@ -2646,15 +2705,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -2664,11 +2720,14 @@ describe('v1.JobServiceClient', () => { client.deleteDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob with LRO error', async () => { @@ -2680,15 +2739,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -2697,11 +2753,14 @@ describe('v1.JobServiceClient', () => { ); const [operation] = await client.deleteDataLabelingJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteDataLabelingJobProgress without error', async () => { @@ -2756,15 +2815,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2773,11 +2829,14 @@ describe('v1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob without error using callback', async () => { @@ -2789,15 +2848,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2827,11 +2883,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob with call error', async () => { @@ -2843,15 +2902,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -2861,11 +2917,14 @@ describe('v1.JobServiceClient', () => { client.deleteHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob with LRO error', async () => { @@ -2877,15 +2936,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -2894,11 +2950,14 @@ describe('v1.JobServiceClient', () => { ); const [operation] = await client.deleteHyperparameterTuningJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { @@ -2954,15 +3013,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2971,11 +3027,14 @@ describe('v1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob without error using callback', async () => { @@ -2987,15 +3046,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3025,11 +3081,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob with call error', async () => { @@ -3041,15 +3100,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3059,11 +3115,14 @@ describe('v1.JobServiceClient', () => { client.deleteBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob with LRO error', async () => { @@ -3075,15 +3134,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3092,11 +3148,14 @@ describe('v1.JobServiceClient', () => { ); const [operation] = await client.deleteBatchPredictionJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { @@ -3152,17 +3211,13 @@ describe('v1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3173,11 +3228,14 @@ describe('v1.JobServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { @@ -3189,17 +3247,13 @@ describe('v1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3229,11 +3283,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob with call error', async () => { @@ -3245,17 +3302,13 @@ describe('v1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -3263,11 +3316,14 @@ describe('v1.JobServiceClient', () => { client.updateModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { @@ -3279,17 +3335,13 @@ describe('v1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -3297,11 +3349,14 @@ describe('v1.JobServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { @@ -3357,15 +3412,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3376,11 +3428,14 @@ describe('v1.JobServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { @@ -3392,15 +3447,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3430,11 +3482,14 @@ describe('v1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { @@ -3446,15 +3501,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -3462,11 +3514,14 @@ describe('v1.JobServiceClient', () => { client.deleteModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { @@ -3478,15 +3533,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -3494,11 +3546,14 @@ describe('v1.JobServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { @@ -3554,15 +3609,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -3577,11 +3628,14 @@ describe('v1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobs without error using callback', async () => { @@ -3593,15 +3647,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -3632,11 +3682,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobs with error', async () => { @@ -3648,26 +3701,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobsStream without error', async () => { @@ -3679,8 +3731,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -3717,11 +3772,12 @@ describe('v1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3734,8 +3790,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3761,11 +3820,12 @@ describe('v1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3778,8 +3838,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -3805,11 +3868,12 @@ describe('v1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3822,8 +3886,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3840,11 +3907,12 @@ describe('v1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3859,15 +3927,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -3883,11 +3947,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listDataLabelingJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobs without error using callback', async () => { @@ -3899,15 +3966,11 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -3938,11 +4001,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobs with error', async () => { @@ -3954,26 +4020,25 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) + expectedError ); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobsStream without error', async () => { @@ -3985,8 +4050,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -4024,11 +4092,12 @@ describe('v1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4041,8 +4110,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4069,11 +4141,12 @@ describe('v1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4086,8 +4159,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -4114,11 +4190,12 @@ describe('v1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4131,8 +4208,11 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4150,11 +4230,12 @@ describe('v1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4169,15 +4250,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -4193,11 +4271,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listHyperparameterTuningJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobs without error using callback', async () => { @@ -4209,15 +4290,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -4250,11 +4328,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobs with error', async () => { @@ -4266,15 +4347,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall( undefined, @@ -4284,11 +4362,14 @@ describe('v1.JobServiceClient', () => { client.listHyperparameterTuningJobs(request), expectedError ); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobsStream without error', async () => { @@ -4300,8 +4381,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -4347,12 +4432,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4365,8 +4453,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4401,12 +4493,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4419,8 +4514,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -4448,12 +4547,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4466,8 +4568,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4486,12 +4592,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4506,15 +4615,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -4530,11 +4636,14 @@ describe('v1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listBatchPredictionJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobs without error using callback', async () => { @@ -4546,15 +4655,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -4587,11 +4693,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobs with error', async () => { @@ -4603,15 +4712,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall( undefined, @@ -4621,11 +4727,14 @@ describe('v1.JobServiceClient', () => { client.listBatchPredictionJobs(request), expectedError ); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobsStream without error', async () => { @@ -4637,8 +4746,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -4679,12 +4792,15 @@ describe('v1.JobServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBatchPredictionJobs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4697,8 +4813,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4728,12 +4848,15 @@ describe('v1.JobServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBatchPredictionJobs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4746,8 +4869,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -4775,12 +4902,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4793,8 +4923,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4813,12 +4947,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4833,15 +4970,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -4858,14 +4992,16 @@ describe('v1.JobServiceClient', () => { const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); assert.deepStrictEqual(response, expectedResponse); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { @@ -4877,15 +5013,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -4918,14 +5051,16 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { @@ -4937,15 +5072,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); @@ -4953,14 +5085,16 @@ describe('v1.JobServiceClient', () => { client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError ); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { @@ -4972,8 +5106,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -5020,12 +5158,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5038,8 +5179,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5075,12 +5220,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5093,8 +5241,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -5123,12 +5275,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5141,8 +5296,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5162,12 +5321,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5182,15 +5344,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -5208,11 +5367,14 @@ describe('v1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { @@ -5224,15 +5386,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -5265,11 +5424,14 @@ describe('v1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobs with error', async () => { @@ -5281,15 +5443,12 @@ describe('v1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall( undefined, @@ -5299,11 +5458,14 @@ describe('v1.JobServiceClient', () => { client.listModelDeploymentMonitoringJobs(request), expectedError ); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { @@ -5315,8 +5477,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -5362,12 +5528,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5380,8 +5549,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5416,12 +5589,15 @@ describe('v1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5434,8 +5610,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -5463,12 +5643,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5481,8 +5664,12 @@ describe('v1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5501,12 +5688,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5981,12 +6171,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -6017,12 +6210,15 @@ describe('v1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_job_service_v1beta1.ts b/test/gapic_job_service_v1beta1.ts index 5f34fd22..b2ac2581 100644 --- a/test/gapic_job_service_v1beta1.ts +++ b/test/gapic_job_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -258,26 +273,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob without error using callback', async () => { @@ -289,15 +303,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -320,11 +330,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob with error', async () => { @@ -336,26 +349,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createCustomJob with closed client', async () => { @@ -367,7 +379,10 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateCustomJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateCustomJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createCustomJob(request), expectedError); @@ -384,26 +399,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob without error using callback', async () => { @@ -415,15 +429,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -446,11 +456,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob with error', async () => { @@ -462,26 +475,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getCustomJob with closed client', async () => { @@ -493,7 +505,10 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetCustomJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getCustomJob(request), expectedError); @@ -510,26 +525,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob without error using callback', async () => { @@ -541,15 +555,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -572,11 +582,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob with error', async () => { @@ -588,26 +601,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelCustomJob with closed client', async () => { @@ -619,7 +631,10 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelCustomJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CancelCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.cancelCustomJob(request), expectedError); @@ -636,15 +651,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -652,11 +664,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob without error using callback', async () => { @@ -668,15 +683,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -699,11 +711,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob with error', async () => { @@ -715,15 +730,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataLabelingJob = stubSimpleCall( undefined, @@ -733,11 +745,14 @@ describe('v1beta1.JobServiceClient', () => { client.createDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.createDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createDataLabelingJob with closed client', async () => { @@ -749,7 +764,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateDataLabelingJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateDataLabelingJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -769,15 +788,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -785,11 +800,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob without error using callback', async () => { @@ -801,15 +819,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -832,11 +846,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob with error', async () => { @@ -848,26 +865,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getDataLabelingJob with closed client', async () => { @@ -879,7 +895,10 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetDataLabelingJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetDataLabelingJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getDataLabelingJob(request), expectedError); @@ -896,15 +915,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -912,11 +928,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelDataLabelingJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob without error using callback', async () => { @@ -928,15 +947,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -959,11 +975,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob with error', async () => { @@ -975,15 +994,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall( undefined, @@ -993,11 +1009,14 @@ describe('v1beta1.JobServiceClient', () => { client.cancelDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelDataLabelingJob with closed client', async () => { @@ -1009,7 +1028,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelDataLabelingJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1029,15 +1052,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1045,11 +1065,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob without error using callback', async () => { @@ -1061,15 +1084,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1092,11 +1112,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob with error', async () => { @@ -1108,15 +1131,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1126,11 +1146,14 @@ describe('v1beta1.JobServiceClient', () => { client.createHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.createHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createHyperparameterTuningJob with closed client', async () => { @@ -1142,7 +1165,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateHyperparameterTuningJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateHyperparameterTuningJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1162,15 +1189,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1178,11 +1202,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob without error using callback', async () => { @@ -1194,15 +1221,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1225,11 +1249,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob with error', async () => { @@ -1241,15 +1268,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1259,11 +1283,14 @@ describe('v1beta1.JobServiceClient', () => { client.getHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.getHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getHyperparameterTuningJob with closed client', async () => { @@ -1275,7 +1302,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetHyperparameterTuningJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1295,15 +1326,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1311,11 +1339,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelHyperparameterTuningJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob without error using callback', async () => { @@ -1327,15 +1358,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1358,11 +1386,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob with error', async () => { @@ -1374,15 +1405,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1392,11 +1420,14 @@ describe('v1beta1.JobServiceClient', () => { client.cancelHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelHyperparameterTuningJob with closed client', async () => { @@ -1408,7 +1439,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelHyperparameterTuningJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1428,15 +1463,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -1444,11 +1476,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob without error using callback', async () => { @@ -1460,15 +1495,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -1491,11 +1523,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob with error', async () => { @@ -1507,15 +1542,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBatchPredictionJob = stubSimpleCall( undefined, @@ -1525,11 +1557,14 @@ describe('v1beta1.JobServiceClient', () => { client.createBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.createBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBatchPredictionJob with closed client', async () => { @@ -1541,7 +1576,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateBatchPredictionJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateBatchPredictionJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1561,15 +1600,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -1577,11 +1613,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob without error using callback', async () => { @@ -1593,15 +1632,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -1624,11 +1660,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob with error', async () => { @@ -1640,15 +1679,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBatchPredictionJob = stubSimpleCall( undefined, @@ -1658,11 +1694,14 @@ describe('v1beta1.JobServiceClient', () => { client.getBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.getBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBatchPredictionJob with closed client', async () => { @@ -1674,7 +1713,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetBatchPredictionJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1694,15 +1737,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1710,11 +1750,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelBatchPredictionJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob without error using callback', async () => { @@ -1726,15 +1769,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1757,11 +1797,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob with error', async () => { @@ -1773,15 +1816,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall( undefined, @@ -1791,11 +1831,14 @@ describe('v1beta1.JobServiceClient', () => { client.cancelBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.cancelBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelBatchPredictionJob with closed client', async () => { @@ -1807,7 +1850,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelBatchPredictionJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1827,15 +1874,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -1845,11 +1889,14 @@ describe('v1beta1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob without error using callback', async () => { @@ -1861,15 +1908,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -1892,11 +1936,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob with error', async () => { @@ -1908,15 +1955,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -1926,11 +1970,14 @@ describe('v1beta1.JobServiceClient', () => { client.createModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createModelDeploymentMonitoringJob with closed client', async () => { @@ -1942,7 +1989,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateModelDeploymentMonitoringJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateModelDeploymentMonitoringJobRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1962,15 +2013,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -1978,11 +2026,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelDeploymentMonitoringJob(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob without error using callback', async () => { @@ -1992,17 +2043,14 @@ describe('v1beta1.JobServiceClient', () => { }); 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, - }, - }, - }; + new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -2025,11 +2073,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob with error', async () => { @@ -2041,15 +2092,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2059,11 +2107,14 @@ describe('v1beta1.JobServiceClient', () => { client.getModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelDeploymentMonitoringJob with closed client', async () => { @@ -2075,7 +2126,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2095,15 +2150,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2113,11 +2165,14 @@ describe('v1beta1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob without error using callback', async () => { @@ -2129,15 +2184,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2160,11 +2212,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob with error', async () => { @@ -2176,15 +2231,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2194,11 +2246,14 @@ describe('v1beta1.JobServiceClient', () => { client.pauseModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.pauseModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes pauseModelDeploymentMonitoringJob with closed client', async () => { @@ -2210,7 +2265,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PauseModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'PauseModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2230,15 +2289,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2248,11 +2304,14 @@ describe('v1beta1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob without error using callback', async () => { @@ -2264,15 +2323,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2295,11 +2351,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob with error', async () => { @@ -2311,15 +2370,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2329,11 +2385,14 @@ describe('v1beta1.JobServiceClient', () => { client.resumeModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resumeModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes resumeModelDeploymentMonitoringJob with closed client', async () => { @@ -2345,7 +2404,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ResumeModelDeploymentMonitoringJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'ResumeModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2365,15 +2428,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2382,11 +2441,14 @@ describe('v1beta1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob without error using callback', async () => { @@ -2398,15 +2460,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2436,11 +2494,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob with call error', async () => { @@ -2452,26 +2513,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteCustomJob with LRO error', async () => { @@ -2483,15 +2543,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteCustomJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -2500,11 +2556,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [operation] = await client.deleteCustomJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteCustomJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteCustomJobProgress without error', async () => { @@ -2559,15 +2618,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2576,11 +2632,14 @@ describe('v1beta1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob without error using callback', async () => { @@ -2592,15 +2651,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2630,11 +2686,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob with call error', async () => { @@ -2646,15 +2705,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -2664,11 +2720,14 @@ describe('v1beta1.JobServiceClient', () => { client.deleteDataLabelingJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteDataLabelingJob with LRO error', async () => { @@ -2680,15 +2739,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteDataLabelingJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -2697,11 +2753,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [operation] = await client.deleteDataLabelingJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteDataLabelingJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDataLabelingJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteDataLabelingJobProgress without error', async () => { @@ -2756,15 +2815,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2773,11 +2829,14 @@ describe('v1beta1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob without error using callback', async () => { @@ -2789,15 +2848,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2827,11 +2883,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob with call error', async () => { @@ -2843,15 +2902,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -2861,11 +2917,14 @@ describe('v1beta1.JobServiceClient', () => { client.deleteHyperparameterTuningJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteHyperparameterTuningJob with LRO error', async () => { @@ -2877,15 +2936,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteHyperparameterTuningJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -2894,11 +2950,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [operation] = await client.deleteHyperparameterTuningJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHyperparameterTuningJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteHyperparameterTuningJobProgress without error', async () => { @@ -2954,15 +3013,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2971,11 +3027,14 @@ describe('v1beta1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob without error using callback', async () => { @@ -2987,15 +3046,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3025,11 +3081,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob with call error', async () => { @@ -3041,15 +3100,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3059,11 +3115,14 @@ describe('v1beta1.JobServiceClient', () => { client.deleteBatchPredictionJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBatchPredictionJob with LRO error', async () => { @@ -3075,15 +3134,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteBatchPredictionJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3092,11 +3148,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [operation] = await client.deleteBatchPredictionJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteBatchPredictionJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBatchPredictionJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteBatchPredictionJobProgress without error', async () => { @@ -3152,17 +3211,13 @@ describe('v1beta1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3173,11 +3228,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob without error using callback', async () => { @@ -3189,17 +3247,13 @@ describe('v1beta1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3229,11 +3283,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob with call error', async () => { @@ -3245,17 +3302,13 @@ describe('v1beta1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -3263,11 +3316,14 @@ describe('v1beta1.JobServiceClient', () => { client.updateModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModelDeploymentMonitoringJob with LRO error', async () => { @@ -3279,17 +3335,13 @@ describe('v1beta1.JobServiceClient', () => { 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, - }, - }, - }; + request.modelDeploymentMonitoringJob ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateModelDeploymentMonitoringJobRequest', + ['modelDeploymentMonitoringJob', 'name'] + ); + request.modelDeploymentMonitoringJob.name = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -3297,11 +3349,14 @@ describe('v1beta1.JobServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateModelDeploymentMonitoringJobProgress without error', async () => { @@ -3357,15 +3412,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3376,11 +3428,14 @@ describe('v1beta1.JobServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob without error using callback', async () => { @@ -3392,15 +3447,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3430,11 +3482,14 @@ describe('v1beta1.JobServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob with call error', async () => { @@ -3446,15 +3501,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -3462,11 +3514,14 @@ describe('v1beta1.JobServiceClient', () => { client.deleteModelDeploymentMonitoringJob(request), expectedError ); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelDeploymentMonitoringJob with LRO error', async () => { @@ -3478,15 +3533,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteModelDeploymentMonitoringJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -3494,11 +3546,14 @@ describe('v1beta1.JobServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelDeploymentMonitoringJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelDeploymentMonitoringJobProgress without error', async () => { @@ -3554,15 +3609,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -3577,11 +3628,14 @@ describe('v1beta1.JobServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobs without error using callback', async () => { @@ -3593,15 +3647,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -3632,11 +3682,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listCustomJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobs with error', async () => { @@ -3648,26 +3701,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCustomJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listCustomJobsStream without error', async () => { @@ -3679,8 +3731,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -3718,11 +3773,12 @@ describe('v1beta1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3735,8 +3791,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3763,11 +3822,12 @@ describe('v1beta1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listCustomJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3780,8 +3840,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -3807,11 +3870,12 @@ describe('v1beta1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3824,8 +3888,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListCustomJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListCustomJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3843,11 +3910,12 @@ describe('v1beta1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listCustomJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3862,15 +3930,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -3886,11 +3950,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listDataLabelingJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobs without error using callback', async () => { @@ -3902,15 +3969,11 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -3943,11 +4006,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDataLabelingJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobs with error', async () => { @@ -3959,26 +4025,25 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) + expectedError ); + await assert.rejects(client.listDataLabelingJobs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataLabelingJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDataLabelingJobsStream without error', async () => { @@ -3990,8 +4055,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -4031,11 +4099,12 @@ describe('v1beta1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4048,8 +4117,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4078,11 +4150,12 @@ describe('v1beta1.JobServiceClient', () => { .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 + assert( + (client.descriptors.page.listDataLabelingJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4095,8 +4168,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -4123,11 +4199,12 @@ describe('v1beta1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4140,8 +4217,11 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListDataLabelingJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDataLabelingJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4159,11 +4239,12 @@ describe('v1beta1.JobServiceClient', () => { ).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 + assert( + (client.descriptors.page.listDataLabelingJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4178,15 +4259,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -4202,11 +4280,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listHyperparameterTuningJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobs without error using callback', async () => { @@ -4218,15 +4299,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -4259,11 +4337,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobs with error', async () => { @@ -4275,15 +4356,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall( undefined, @@ -4293,11 +4371,14 @@ describe('v1beta1.JobServiceClient', () => { client.listHyperparameterTuningJobs(request), expectedError ); - assert( - (client.innerApiCalls.listHyperparameterTuningJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHyperparameterTuningJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listHyperparameterTuningJobsStream without error', async () => { @@ -4309,8 +4390,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -4356,12 +4441,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4374,8 +4462,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4410,12 +4502,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4428,8 +4523,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -4457,12 +4556,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4475,8 +4577,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListHyperparameterTuningJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListHyperparameterTuningJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4495,12 +4601,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listHyperparameterTuningJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4515,15 +4624,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -4539,11 +4645,14 @@ describe('v1beta1.JobServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listBatchPredictionJobs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobs without error using callback', async () => { @@ -4555,15 +4664,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -4596,11 +4702,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobs with error', async () => { @@ -4612,15 +4721,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall( undefined, @@ -4630,11 +4736,14 @@ describe('v1beta1.JobServiceClient', () => { client.listBatchPredictionJobs(request), expectedError ); - assert( - (client.innerApiCalls.listBatchPredictionJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBatchPredictionJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBatchPredictionJobsStream without error', async () => { @@ -4646,8 +4755,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -4690,12 +4803,15 @@ describe('v1beta1.JobServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBatchPredictionJobs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4708,8 +4824,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4741,12 +4861,15 @@ describe('v1beta1.JobServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBatchPredictionJobs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4759,8 +4882,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -4788,12 +4915,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4806,8 +4936,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListBatchPredictionJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListBatchPredictionJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4826,12 +4960,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listBatchPredictionJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4846,15 +4983,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -4871,14 +5005,16 @@ describe('v1beta1.JobServiceClient', () => { const [response] = await client.searchModelDeploymentMonitoringStatsAnomalies(request); assert.deepStrictEqual(response, expectedResponse); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomalies without error using callback', async () => { @@ -4890,15 +5026,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -4931,14 +5064,16 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomalies with error', async () => { @@ -4950,15 +5085,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); @@ -4966,14 +5098,16 @@ describe('v1beta1.JobServiceClient', () => { client.searchModelDeploymentMonitoringStatsAnomalies(request), expectedError ); - assert( - ( - client.innerApiCalls - .searchModelDeploymentMonitoringStatsAnomalies as SinonStub - ) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls + .searchModelDeploymentMonitoringStatsAnomalies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchModelDeploymentMonitoringStatsAnomaliesStream without error', async () => { @@ -4985,8 +5119,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -5033,12 +5171,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5051,8 +5192,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5088,12 +5233,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5106,8 +5254,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -5136,12 +5288,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5154,8 +5309,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchModelDeploymentMonitoringStatsAnomaliesRequest() ); - request.modelDeploymentMonitoringJob = ''; - const expectedHeaderRequestParams = 'model_deployment_monitoring_job='; + const defaultValue1 = getTypeDefaultValue( + 'SearchModelDeploymentMonitoringStatsAnomaliesRequest', + ['modelDeploymentMonitoringJob'] + ); + request.modelDeploymentMonitoringJob = defaultValue1; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5175,12 +5334,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5195,15 +5357,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -5221,11 +5380,14 @@ describe('v1beta1.JobServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobs without error using callback', async () => { @@ -5237,15 +5399,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -5278,11 +5437,14 @@ describe('v1beta1.JobServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobs with error', async () => { @@ -5294,15 +5456,12 @@ describe('v1beta1.JobServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall( undefined, @@ -5312,11 +5471,14 @@ describe('v1beta1.JobServiceClient', () => { client.listModelDeploymentMonitoringJobs(request), expectedError ); - assert( - (client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelDeploymentMonitoringJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelDeploymentMonitoringJobsStream without error', async () => { @@ -5328,8 +5490,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -5375,12 +5541,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5393,8 +5562,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5429,12 +5602,15 @@ describe('v1beta1.JobServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5447,8 +5623,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -5476,12 +5656,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5494,8 +5677,12 @@ describe('v1beta1.JobServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelDeploymentMonitoringJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelDeploymentMonitoringJobsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5514,12 +5701,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelDeploymentMonitoringJobs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5994,12 +6184,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -6030,12 +6223,15 @@ describe('v1beta1.JobServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_metadata_service_v1.ts b/test/gapic_metadata_service_v1.ts index a8215865..17f88e6c 100644 --- a/test/gapic_metadata_service_v1.ts +++ b/test/gapic_metadata_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore without error using callback', async () => { @@ -291,15 +305,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() ); @@ -322,11 +332,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore with error', async () => { @@ -338,26 +351,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore with closed client', async () => { @@ -369,7 +381,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetMetadataStoreRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetadataStore(request), expectedError); @@ -386,26 +401,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact without error using callback', async () => { @@ -417,15 +431,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -448,11 +458,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact with error', async () => { @@ -464,26 +477,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact with closed client', async () => { @@ -495,7 +507,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateArtifactRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createArtifact(request), expectedError); @@ -512,26 +527,23 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact without error using callback', async () => { @@ -543,15 +555,9 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -574,11 +580,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact with error', async () => { @@ -590,26 +599,23 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact with closed client', async () => { @@ -621,7 +627,8 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetArtifactRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getArtifact(request), expectedError); @@ -638,27 +645,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact without error using callback', async () => { @@ -670,16 +677,13 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -702,11 +706,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact with error', async () => { @@ -718,27 +725,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact with closed client', async () => { @@ -750,8 +757,12 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateArtifactRequest() ); - request.artifact = {}; - request.artifact.name = ''; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateArtifact(request), expectedError); @@ -768,26 +779,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext without error using callback', async () => { @@ -799,15 +809,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -830,11 +836,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext with error', async () => { @@ -846,26 +855,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext with closed client', async () => { @@ -877,7 +885,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateContextRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createContext(request), expectedError); @@ -894,26 +905,23 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext without error using callback', async () => { @@ -925,15 +933,9 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -956,11 +958,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext with error', async () => { @@ -972,26 +977,23 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext with closed client', async () => { @@ -1003,7 +1005,8 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetContextRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getContext(request), expectedError); @@ -1020,27 +1023,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext without error using callback', async () => { @@ -1052,16 +1055,13 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -1084,11 +1084,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext with error', async () => { @@ -1100,27 +1103,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext with closed client', async () => { @@ -1132,8 +1135,12 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateContextRequest() ); - request.context = {}; - request.context.name = ''; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateContext(request), expectedError); @@ -1150,15 +1157,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse() ); @@ -1166,11 +1170,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addContextArtifactsAndExecutions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions without error using callback', async () => { @@ -1182,15 +1189,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse() ); @@ -1213,11 +1217,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions with error', async () => { @@ -1229,15 +1236,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall( undefined, @@ -1247,11 +1251,14 @@ describe('v1.MetadataServiceClient', () => { client.addContextArtifactsAndExecutions(request), expectedError ); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions with closed client', async () => { @@ -1263,7 +1270,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1283,15 +1294,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse() ); @@ -1299,11 +1306,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addContextChildren(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren without error using callback', async () => { @@ -1315,15 +1325,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse() ); @@ -1346,11 +1352,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren with error', async () => { @@ -1362,26 +1371,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren with closed client', async () => { @@ -1393,7 +1401,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextChildrenRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addContextChildren(request), expectedError); @@ -1410,15 +1421,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -1426,11 +1434,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryContextLineageSubgraph(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph without error using callback', async () => { @@ -1442,15 +1453,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -1473,11 +1481,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph with error', async () => { @@ -1489,15 +1500,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall( undefined, @@ -1507,11 +1515,14 @@ describe('v1.MetadataServiceClient', () => { client.queryContextLineageSubgraph(request), expectedError ); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph with closed client', async () => { @@ -1523,7 +1534,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.QueryContextLineageSubgraphRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1543,26 +1558,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution without error using callback', async () => { @@ -1574,15 +1588,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1605,11 +1615,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution with error', async () => { @@ -1621,26 +1634,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution with closed client', async () => { @@ -1652,7 +1664,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateExecutionRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createExecution(request), expectedError); @@ -1669,26 +1684,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution without error using callback', async () => { @@ -1700,15 +1714,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1731,11 +1741,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution with error', async () => { @@ -1747,26 +1760,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution with closed client', async () => { @@ -1778,7 +1790,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetExecutionRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getExecution(request), expectedError); @@ -1795,27 +1810,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution without error using callback', async () => { @@ -1827,16 +1842,13 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1859,11 +1871,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution with error', async () => { @@ -1875,27 +1890,27 @@ describe('v1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution with closed client', async () => { @@ -1907,8 +1922,12 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateExecutionRequest() ); - request.execution = {}; - request.execution.name = ''; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateExecution(request), expectedError); @@ -1925,15 +1944,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse() ); @@ -1941,11 +1956,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addExecutionEvents(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents without error using callback', async () => { @@ -1957,15 +1975,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse() ); @@ -1988,11 +2002,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents with error', async () => { @@ -2004,26 +2021,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents with closed client', async () => { @@ -2035,7 +2051,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddExecutionEventsRequest() ); - request.execution = ''; + const defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addExecutionEvents(request), expectedError); @@ -2052,15 +2071,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2068,11 +2084,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryExecutionInputsAndOutputs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { @@ -2084,15 +2103,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2115,11 +2131,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs with error', async () => { @@ -2131,15 +2150,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall( undefined, @@ -2149,11 +2165,14 @@ describe('v1.MetadataServiceClient', () => { client.queryExecutionInputsAndOutputs(request), expectedError ); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs with closed client', async () => { @@ -2165,7 +2184,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.QueryExecutionInputsAndOutputsRequest() ); - request.execution = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2185,15 +2208,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2201,11 +2220,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createMetadataSchema(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema without error using callback', async () => { @@ -2217,15 +2239,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2248,11 +2266,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema with error', async () => { @@ -2264,26 +2285,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema with closed client', async () => { @@ -2295,7 +2315,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateMetadataSchemaRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createMetadataSchema(request), expectedError); @@ -2312,26 +2335,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema without error using callback', async () => { @@ -2343,15 +2365,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2374,11 +2392,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema with error', async () => { @@ -2390,26 +2411,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema with closed client', async () => { @@ -2421,7 +2441,10 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetMetadataSchemaRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetadataSchema(request), expectedError); @@ -2438,15 +2461,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2454,11 +2474,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryArtifactLineageSubgraph(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph without error using callback', async () => { @@ -2470,15 +2493,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2501,11 +2521,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph with error', async () => { @@ -2517,15 +2540,12 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall( undefined, @@ -2535,11 +2555,14 @@ describe('v1.MetadataServiceClient', () => { client.queryArtifactLineageSubgraph(request), expectedError ); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph with closed client', async () => { @@ -2551,7 +2574,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.QueryArtifactLineageSubgraphRequest() ); - request.artifact = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2571,15 +2598,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2588,11 +2611,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore without error using callback', async () => { @@ -2604,15 +2630,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2642,11 +2664,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore with call error', async () => { @@ -2658,26 +2683,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore with LRO error', async () => { @@ -2689,15 +2713,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -2706,11 +2726,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.createMetadataStore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateMetadataStoreProgress without error', async () => { @@ -2765,15 +2788,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2782,11 +2801,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore without error using callback', async () => { @@ -2798,15 +2820,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2836,11 +2854,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore with call error', async () => { @@ -2852,26 +2873,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore with LRO error', async () => { @@ -2883,15 +2903,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -2900,11 +2916,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.deleteMetadataStore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteMetadataStoreProgress without error', async () => { @@ -2959,15 +2978,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2976,11 +2991,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact without error using callback', async () => { @@ -2992,15 +3010,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3030,11 +3044,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact with call error', async () => { @@ -3046,26 +3063,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact with LRO error', async () => { @@ -3077,15 +3093,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3094,11 +3106,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.deleteArtifact(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteArtifactProgress without error', async () => { @@ -3153,15 +3168,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3170,11 +3181,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts without error using callback', async () => { @@ -3186,15 +3200,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3224,11 +3234,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts with call error', async () => { @@ -3240,26 +3253,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts with LRO error', async () => { @@ -3271,15 +3283,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3288,11 +3296,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.purgeArtifacts(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeArtifactsProgress without error', async () => { @@ -3347,15 +3358,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3364,11 +3371,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext without error using callback', async () => { @@ -3380,15 +3390,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3418,11 +3424,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext with call error', async () => { @@ -3434,26 +3443,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext with LRO error', async () => { @@ -3465,15 +3473,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3482,11 +3486,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.deleteContext(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteContextProgress without error', async () => { @@ -3541,15 +3548,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3558,11 +3561,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts without error using callback', async () => { @@ -3574,15 +3580,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3612,11 +3614,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts with call error', async () => { @@ -3628,26 +3633,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts with LRO error', async () => { @@ -3659,15 +3663,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -3676,11 +3676,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.purgeContexts(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeContextsProgress without error', async () => { @@ -3735,15 +3738,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3752,11 +3751,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution without error using callback', async () => { @@ -3768,15 +3770,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3806,11 +3804,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution with call error', async () => { @@ -3822,26 +3823,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution with LRO error', async () => { @@ -3853,15 +3853,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -3870,11 +3866,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.deleteExecution(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteExecutionProgress without error', async () => { @@ -3929,15 +3928,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3946,11 +3941,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions without error using callback', async () => { @@ -3962,15 +3960,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4000,11 +3994,14 @@ describe('v1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions with call error', async () => { @@ -4016,26 +4013,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions with LRO error', async () => { @@ -4047,15 +4043,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4064,11 +4056,14 @@ describe('v1.MetadataServiceClient', () => { ); const [operation] = await client.purgeExecutions(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeExecutionsProgress without error', async () => { @@ -4123,15 +4118,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4146,12 +4137,15 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStores without error using callback', async () => { @@ -4163,15 +4157,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4202,11 +4192,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStores with error', async () => { @@ -4218,26 +4211,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStoresStream without error', async () => { @@ -4249,8 +4241,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4287,11 +4282,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4304,8 +4300,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4331,11 +4330,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4348,8 +4348,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4375,11 +4378,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4392,8 +4396,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4411,11 +4418,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4430,15 +4438,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4447,11 +4451,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifacts without error using callback', async () => { @@ -4463,15 +4470,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4496,11 +4499,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifacts with error', async () => { @@ -4512,26 +4518,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifactsStream without error', async () => { @@ -4543,8 +4548,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4575,11 +4583,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4592,8 +4601,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4619,11 +4631,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4636,8 +4649,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4657,11 +4673,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4674,8 +4691,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4692,11 +4712,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4711,15 +4732,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -4728,11 +4745,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContexts without error using callback', async () => { @@ -4744,15 +4764,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -4777,11 +4793,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContexts with error', async () => { @@ -4793,26 +4812,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContextsStream without error', async () => { @@ -4824,8 +4842,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -4856,11 +4877,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4873,8 +4895,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.createStream = stubPageStreamingCall( undefined, @@ -4902,11 +4927,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4919,8 +4945,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -4940,11 +4969,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4957,8 +4987,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4975,11 +5008,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4994,15 +5028,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5017,11 +5047,14 @@ describe('v1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutions without error using callback', async () => { @@ -5033,15 +5066,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5072,11 +5101,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutions with error', async () => { @@ -5088,26 +5120,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutionsStream without error', async () => { @@ -5119,8 +5150,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5157,11 +5191,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5174,8 +5209,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5201,11 +5239,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5218,8 +5257,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5245,11 +5287,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5262,8 +5305,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5280,11 +5326,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5299,15 +5346,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5323,11 +5366,14 @@ describe('v1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listMetadataSchemas(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemas without error using callback', async () => { @@ -5339,15 +5385,11 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5378,11 +5420,14 @@ describe('v1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemas with error', async () => { @@ -5394,26 +5439,25 @@ describe('v1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemasStream without error', async () => { @@ -5425,8 +5469,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5464,11 +5511,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5481,8 +5529,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5509,11 +5560,12 @@ describe('v1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5526,8 +5578,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5553,11 +5608,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5570,8 +5626,11 @@ describe('v1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5589,11 +5648,12 @@ describe('v1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -6068,12 +6128,15 @@ describe('v1.MetadataServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -6104,12 +6167,15 @@ describe('v1.MetadataServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_metadata_service_v1beta1.ts b/test/gapic_metadata_service_v1beta1.ts index bb145fbb..5fff4422 100644 --- a/test/gapic_metadata_service_v1beta1.ts +++ b/test/gapic_metadata_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore without error using callback', async () => { @@ -291,15 +305,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() ); @@ -322,11 +332,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore with error', async () => { @@ -338,26 +351,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataStore with closed client', async () => { @@ -369,7 +381,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetMetadataStoreRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetadataStore(request), expectedError); @@ -386,26 +401,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact without error using callback', async () => { @@ -417,15 +431,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -448,11 +458,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact with error', async () => { @@ -464,26 +477,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createArtifact with closed client', async () => { @@ -495,7 +507,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateArtifactRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateArtifactRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createArtifact(request), expectedError); @@ -512,26 +527,23 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact without error using callback', async () => { @@ -543,15 +555,9 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -574,11 +580,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact with error', async () => { @@ -590,26 +599,23 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getArtifact with closed client', async () => { @@ -621,7 +627,8 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetArtifactRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetArtifactRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getArtifact(request), expectedError); @@ -638,27 +645,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact without error using callback', async () => { @@ -670,16 +677,13 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -702,11 +706,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact with error', async () => { @@ -718,27 +725,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateArtifact with closed client', async () => { @@ -750,8 +757,12 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateArtifactRequest() ); - request.artifact = {}; - request.artifact.name = ''; + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateArtifactRequest', [ + 'artifact', + 'name', + ]); + request.artifact.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateArtifact(request), expectedError); @@ -768,26 +779,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext without error using callback', async () => { @@ -799,15 +809,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -830,11 +836,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext with error', async () => { @@ -846,26 +855,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createContext with closed client', async () => { @@ -877,7 +885,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateContextRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateContextRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createContext(request), expectedError); @@ -894,26 +905,23 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext without error using callback', async () => { @@ -925,15 +933,9 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -956,11 +958,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext with error', async () => { @@ -972,26 +977,23 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getContext with closed client', async () => { @@ -1003,7 +1005,8 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetContextRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetContextRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getContext(request), expectedError); @@ -1020,27 +1023,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext without error using callback', async () => { @@ -1052,16 +1055,13 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -1084,11 +1084,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext with error', async () => { @@ -1100,27 +1103,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; + const expectedHeaderRequestParams = `context.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateContext with closed client', async () => { @@ -1132,8 +1135,12 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateContextRequest() ); - request.context = {}; - request.context.name = ''; + request.context ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateContextRequest', [ + 'context', + 'name', + ]); + request.context.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateContext(request), expectedError); @@ -1150,15 +1157,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse() ); @@ -1166,11 +1170,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addContextArtifactsAndExecutions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions without error using callback', async () => { @@ -1182,15 +1189,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse() ); @@ -1213,11 +1217,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions with error', async () => { @@ -1229,15 +1236,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall( undefined, @@ -1247,11 +1251,14 @@ describe('v1beta1.MetadataServiceClient', () => { client.addContextArtifactsAndExecutions(request), expectedError ); - assert( - (client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextArtifactsAndExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextArtifactsAndExecutions with closed client', async () => { @@ -1263,7 +1270,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue( + 'AddContextArtifactsAndExecutionsRequest', + ['context'] + ); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1283,15 +1294,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse() ); @@ -1299,11 +1306,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addContextChildren(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren without error using callback', async () => { @@ -1315,15 +1325,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse() ); @@ -1346,11 +1352,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addContextChildren as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren with error', async () => { @@ -1362,26 +1371,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addContextChildren as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addContextChildren with closed client', async () => { @@ -1393,7 +1401,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue('AddContextChildrenRequest', [ + 'context', + ]); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addContextChildren(request), expectedError); @@ -1410,15 +1421,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -1426,11 +1434,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryContextLineageSubgraph(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph without error using callback', async () => { @@ -1442,15 +1453,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -1473,11 +1481,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph with error', async () => { @@ -1489,15 +1500,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; + const expectedHeaderRequestParams = `context=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall( undefined, @@ -1507,11 +1515,14 @@ describe('v1beta1.MetadataServiceClient', () => { client.queryContextLineageSubgraph(request), expectedError ); - assert( - (client.innerApiCalls.queryContextLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryContextLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryContextLineageSubgraph with closed client', async () => { @@ -1523,7 +1534,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryContextLineageSubgraphRequest() ); - request.context = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryContextLineageSubgraphRequest', + ['context'] + ); + request.context = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1543,26 +1558,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution without error using callback', async () => { @@ -1574,15 +1588,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1605,11 +1615,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution with error', async () => { @@ -1621,26 +1634,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createExecution with closed client', async () => { @@ -1652,7 +1664,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateExecutionRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateExecutionRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createExecution(request), expectedError); @@ -1669,26 +1684,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution without error using callback', async () => { @@ -1700,15 +1714,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1731,11 +1741,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution with error', async () => { @@ -1747,26 +1760,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getExecution with closed client', async () => { @@ -1778,7 +1790,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetExecutionRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getExecution(request), expectedError); @@ -1795,27 +1810,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution without error using callback', async () => { @@ -1827,16 +1842,13 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1859,11 +1871,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution with error', async () => { @@ -1875,27 +1890,27 @@ describe('v1beta1.MetadataServiceClient', () => { 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, - }, - }, - }; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; + const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExecution with closed client', async () => { @@ -1907,8 +1922,12 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateExecutionRequest() ); - request.execution = {}; - request.execution.name = ''; + request.execution ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateExecutionRequest', [ + 'execution', + 'name', + ]); + request.execution.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateExecution(request), expectedError); @@ -1925,15 +1944,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse() ); @@ -1941,11 +1956,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addExecutionEvents(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents without error using callback', async () => { @@ -1957,15 +1975,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse() ); @@ -1988,11 +2002,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addExecutionEvents as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents with error', async () => { @@ -2004,26 +2021,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addExecutionEvents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addExecutionEvents with closed client', async () => { @@ -2035,7 +2051,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsRequest() ); - request.execution = ''; + const defaultValue1 = getTypeDefaultValue('AddExecutionEventsRequest', [ + 'execution', + ]); + request.execution = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addExecutionEvents(request), expectedError); @@ -2052,15 +2071,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2068,11 +2084,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryExecutionInputsAndOutputs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs without error using callback', async () => { @@ -2084,15 +2103,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2115,11 +2131,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs with error', async () => { @@ -2131,15 +2150,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; + const expectedHeaderRequestParams = `execution=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall( undefined, @@ -2149,11 +2165,14 @@ describe('v1beta1.MetadataServiceClient', () => { client.queryExecutionInputsAndOutputs(request), expectedError ); - assert( - (client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryExecutionInputsAndOutputs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryExecutionInputsAndOutputs with closed client', async () => { @@ -2165,7 +2184,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryExecutionInputsAndOutputsRequest() ); - request.execution = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryExecutionInputsAndOutputsRequest', + ['execution'] + ); + request.execution = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2185,15 +2208,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2201,11 +2220,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createMetadataSchema(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema without error using callback', async () => { @@ -2217,15 +2239,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2248,11 +2266,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema with error', async () => { @@ -2264,26 +2285,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataSchema with closed client', async () => { @@ -2295,7 +2315,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateMetadataSchemaRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateMetadataSchemaRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createMetadataSchema(request), expectedError); @@ -2312,26 +2335,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema without error using callback', async () => { @@ -2343,15 +2365,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2374,11 +2392,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getMetadataSchema as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema with error', async () => { @@ -2390,26 +2411,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMetadataSchema as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getMetadataSchema with closed client', async () => { @@ -2421,7 +2441,10 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetMetadataSchemaRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetMetadataSchemaRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getMetadataSchema(request), expectedError); @@ -2438,15 +2461,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2454,11 +2474,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.queryArtifactLineageSubgraph(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph without error using callback', async () => { @@ -2470,15 +2493,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2501,11 +2521,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph with error', async () => { @@ -2517,15 +2540,12 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; + const expectedHeaderRequestParams = `artifact=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall( undefined, @@ -2535,11 +2555,14 @@ describe('v1beta1.MetadataServiceClient', () => { client.queryArtifactLineageSubgraph(request), expectedError ); - assert( - (client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryArtifactLineageSubgraph as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes queryArtifactLineageSubgraph with closed client', async () => { @@ -2551,7 +2574,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryArtifactLineageSubgraphRequest() ); - request.artifact = ''; + const defaultValue1 = getTypeDefaultValue( + 'QueryArtifactLineageSubgraphRequest', + ['artifact'] + ); + request.artifact = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2571,15 +2598,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2588,11 +2611,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore without error using callback', async () => { @@ -2604,15 +2630,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2642,11 +2664,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore with call error', async () => { @@ -2658,26 +2683,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createMetadataStore with LRO error', async () => { @@ -2689,15 +2713,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateMetadataStoreRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -2706,11 +2726,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.createMetadataStore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateMetadataStoreProgress without error', async () => { @@ -2765,15 +2788,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2782,11 +2801,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore without error using callback', async () => { @@ -2798,15 +2820,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2836,11 +2854,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore with call error', async () => { @@ -2852,26 +2873,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteMetadataStore with LRO error', async () => { @@ -2883,15 +2903,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteMetadataStoreRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -2900,11 +2916,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.deleteMetadataStore(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteMetadataStore as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMetadataStore as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteMetadataStoreProgress without error', async () => { @@ -2959,15 +2978,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2976,11 +2991,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact without error using callback', async () => { @@ -2992,15 +3010,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3030,11 +3044,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact with call error', async () => { @@ -3046,26 +3063,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteArtifact with LRO error', async () => { @@ -3077,15 +3093,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteArtifactRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3094,11 +3106,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.deleteArtifact(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteArtifactProgress without error', async () => { @@ -3153,15 +3168,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3170,11 +3181,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts without error using callback', async () => { @@ -3186,15 +3200,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3224,11 +3234,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts with call error', async () => { @@ -3240,26 +3253,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeArtifacts with LRO error', async () => { @@ -3271,15 +3283,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3288,11 +3296,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.purgeArtifacts(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeArtifactsProgress without error', async () => { @@ -3347,15 +3358,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3364,11 +3371,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext without error using callback', async () => { @@ -3380,15 +3390,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3418,11 +3424,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext with call error', async () => { @@ -3434,26 +3443,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteContext with LRO error', async () => { @@ -3465,15 +3473,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteContextRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3482,11 +3486,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.deleteContext(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteContext as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteContext as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteContextProgress without error', async () => { @@ -3541,15 +3548,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3558,11 +3561,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts without error using callback', async () => { @@ -3574,15 +3580,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3612,11 +3614,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts with call error', async () => { @@ -3628,26 +3633,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeContexts with LRO error', async () => { @@ -3659,15 +3663,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -3676,11 +3676,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.purgeContexts(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeContextsProgress without error', async () => { @@ -3735,15 +3738,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3752,11 +3751,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution without error using callback', async () => { @@ -3768,15 +3770,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3806,11 +3804,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution with call error', async () => { @@ -3822,26 +3823,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteExecution with LRO error', async () => { @@ -3853,15 +3853,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteExecutionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -3870,11 +3866,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.deleteExecution(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteExecution as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteExecution as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteExecutionProgress without error', async () => { @@ -3929,15 +3928,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3946,11 +3941,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions without error using callback', async () => { @@ -3962,15 +3960,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4000,11 +3994,14 @@ describe('v1beta1.MetadataServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions with call error', async () => { @@ -4016,26 +4013,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes purgeExecutions with LRO error', async () => { @@ -4047,15 +4043,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PurgeExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4064,11 +4056,14 @@ describe('v1beta1.MetadataServiceClient', () => { ); const [operation] = await client.purgeExecutions(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.purgeExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.purgeExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkPurgeExecutionsProgress without error', async () => { @@ -4123,15 +4118,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4146,12 +4137,15 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStores without error using callback', async () => { @@ -4163,15 +4157,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4204,11 +4194,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataStores as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStores with error', async () => { @@ -4220,26 +4213,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataStores as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataStoresStream without error', async () => { @@ -4251,8 +4243,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4290,11 +4285,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4307,8 +4303,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4335,11 +4334,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataStores.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4352,8 +4352,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4380,11 +4383,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4397,8 +4401,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataStoresRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataStoresRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4416,11 +4423,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataStores.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4435,15 +4443,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4458,11 +4462,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifacts without error using callback', async () => { @@ -4474,15 +4481,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4513,11 +4516,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifacts with error', async () => { @@ -4529,26 +4535,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listArtifactsStream without error', async () => { @@ -4560,8 +4565,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4598,11 +4606,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4615,8 +4624,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4642,11 +4654,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4659,8 +4672,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4686,11 +4702,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4703,8 +4720,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListArtifactsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListArtifactsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4722,11 +4742,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4741,15 +4762,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -4764,11 +4781,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContexts without error using callback', async () => { @@ -4780,15 +4800,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -4819,11 +4835,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listContexts as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContexts with error', async () => { @@ -4835,26 +4854,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listContextsStream without error', async () => { @@ -4866,8 +4884,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -4904,11 +4925,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4921,8 +4943,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.createStream = stubPageStreamingCall( undefined, @@ -4950,11 +4975,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listContexts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4967,8 +4993,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -4994,11 +5023,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5011,8 +5041,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListContextsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListContextsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5029,11 +5062,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listContexts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5048,15 +5082,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5071,11 +5101,14 @@ describe('v1beta1.MetadataServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutions without error using callback', async () => { @@ -5087,15 +5120,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5126,11 +5155,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listExecutions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutions with error', async () => { @@ -5142,26 +5174,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listExecutions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listExecutionsStream without error', async () => { @@ -5173,8 +5204,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5212,11 +5246,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5229,8 +5264,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5257,11 +5295,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listExecutions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5274,8 +5313,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5301,11 +5343,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5318,8 +5361,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListExecutionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListExecutionsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5337,11 +5383,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listExecutions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5356,15 +5403,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5380,11 +5423,14 @@ describe('v1beta1.MetadataServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listMetadataSchemas(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemas without error using callback', async () => { @@ -5396,15 +5442,11 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5437,11 +5479,14 @@ describe('v1beta1.MetadataServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listMetadataSchemas as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemas with error', async () => { @@ -5453,26 +5498,25 @@ describe('v1beta1.MetadataServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMetadataSchemas as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listMetadataSchemasStream without error', async () => { @@ -5484,8 +5528,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5523,11 +5570,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5540,8 +5588,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5568,11 +5619,12 @@ describe('v1beta1.MetadataServiceClient', () => { .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 + assert( + (client.descriptors.page.listMetadataSchemas.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5585,8 +5637,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5613,11 +5668,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5630,8 +5686,11 @@ describe('v1beta1.MetadataServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListMetadataSchemasRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListMetadataSchemasRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5649,11 +5708,12 @@ describe('v1beta1.MetadataServiceClient', () => { ).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 + assert( + (client.descriptors.page.listMetadataSchemas.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -6128,12 +6188,15 @@ describe('v1beta1.MetadataServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -6164,12 +6227,15 @@ describe('v1beta1.MetadataServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_migration_service_v1.ts b/test/gapic_migration_service_v1.ts index b1324c06..f4b33379 100644 --- a/test/gapic_migration_service_v1.ts +++ b/test/gapic_migration_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,15 +275,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -277,11 +289,14 @@ describe('v1.MigrationServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources without error using callback', async () => { @@ -293,15 +308,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -331,11 +343,14 @@ describe('v1.MigrationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources with call error', async () => { @@ -347,15 +362,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -365,11 +377,14 @@ describe('v1.MigrationServiceClient', () => { client.batchMigrateResources(request), expectedError ); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources with LRO error', async () => { @@ -381,15 +396,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -398,11 +410,14 @@ describe('v1.MigrationServiceClient', () => { ); const [operation] = await client.batchMigrateResources(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchMigrateResourcesProgress without error', async () => { @@ -457,15 +472,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -481,11 +493,14 @@ describe('v1.MigrationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchMigratableResources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResources without error using callback', async () => { @@ -497,15 +512,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -538,11 +550,14 @@ describe('v1.MigrationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResources with error', async () => { @@ -554,15 +569,12 @@ describe('v1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchMigratableResources = stubSimpleCall( undefined, @@ -572,11 +584,14 @@ describe('v1.MigrationServiceClient', () => { client.searchMigratableResources(request), expectedError ); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResourcesStream without error', async () => { @@ -588,8 +603,12 @@ describe('v1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -630,12 +649,15 @@ describe('v1.MigrationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchMigratableResources, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -648,8 +670,12 @@ describe('v1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -679,12 +705,15 @@ describe('v1.MigrationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchMigratableResources, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -697,8 +726,12 @@ describe('v1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -726,12 +759,15 @@ describe('v1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -744,8 +780,12 @@ describe('v1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -764,12 +804,15 @@ describe('v1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1244,12 +1287,15 @@ describe('v1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1280,12 +1326,15 @@ describe('v1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_migration_service_v1beta1.ts b/test/gapic_migration_service_v1beta1.ts index 3ce1bd84..91031cdc 100644 --- a/test/gapic_migration_service_v1beta1.ts +++ b/test/gapic_migration_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -261,15 +276,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -278,11 +290,14 @@ describe('v1beta1.MigrationServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources without error using callback', async () => { @@ -294,15 +309,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -332,11 +344,14 @@ describe('v1beta1.MigrationServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources with call error', async () => { @@ -348,15 +363,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -366,11 +378,14 @@ describe('v1beta1.MigrationServiceClient', () => { client.batchMigrateResources(request), expectedError ); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchMigrateResources with LRO error', async () => { @@ -382,15 +397,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchMigrateResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -399,11 +411,14 @@ describe('v1beta1.MigrationServiceClient', () => { ); const [operation] = await client.batchMigrateResources(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.batchMigrateResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchMigrateResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkBatchMigrateResourcesProgress without error', async () => { @@ -458,15 +473,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -482,11 +494,14 @@ describe('v1beta1.MigrationServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.searchMigratableResources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResources without error using callback', async () => { @@ -498,15 +513,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -539,11 +551,14 @@ describe('v1beta1.MigrationServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResources with error', async () => { @@ -555,15 +570,12 @@ describe('v1beta1.MigrationServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.searchMigratableResources = stubSimpleCall( undefined, @@ -573,11 +585,14 @@ describe('v1beta1.MigrationServiceClient', () => { client.searchMigratableResources(request), expectedError ); - assert( - (client.innerApiCalls.searchMigratableResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.searchMigratableResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes searchMigratableResourcesStream without error', async () => { @@ -589,8 +604,12 @@ describe('v1beta1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -633,12 +652,15 @@ describe('v1beta1.MigrationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchMigratableResources, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -651,8 +673,12 @@ describe('v1beta1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -684,12 +710,15 @@ describe('v1beta1.MigrationServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.searchMigratableResources, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -702,8 +731,12 @@ describe('v1beta1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -731,12 +764,15 @@ describe('v1beta1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -749,8 +785,12 @@ describe('v1beta1.MigrationServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchMigratableResourcesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'SearchMigratableResourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -769,12 +809,15 @@ describe('v1beta1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.searchMigratableResources .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1249,12 +1292,15 @@ describe('v1beta1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1285,12 +1331,15 @@ describe('v1beta1.MigrationServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_model_service_v1.ts b/test/gapic_model_service_v1.ts index 9b934fa7..0d724f48 100644 --- a/test/gapic_model_service_v1.ts +++ b/test/gapic_model_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -258,26 +273,23 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel without error using callback', async () => { @@ -289,15 +301,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -320,11 +326,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel with error', async () => { @@ -336,23 +345,20 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel with closed client', async () => { @@ -364,7 +370,8 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetModelRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getModel(request), expectedError); @@ -381,27 +388,27 @@ describe('v1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel without error using callback', async () => { @@ -413,16 +420,13 @@ describe('v1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -445,11 +449,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel with error', async () => { @@ -461,27 +468,27 @@ describe('v1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel with closed client', async () => { @@ -493,8 +500,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateModelRequest() ); - request.model = {}; - request.model.name = ''; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateModel(request), expectedError); @@ -511,15 +522,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -527,11 +534,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.mergeVersionAliases(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases without error using callback', async () => { @@ -543,15 +553,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -574,11 +580,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases with error', async () => { @@ -590,26 +599,25 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases with closed client', async () => { @@ -621,7 +629,10 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MergeVersionAliasesRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.mergeVersionAliases(request), expectedError); @@ -638,15 +649,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -654,11 +662,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.importModelEvaluation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation without error using callback', async () => { @@ -670,15 +681,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -701,11 +709,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation with error', async () => { @@ -717,15 +728,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importModelEvaluation = stubSimpleCall( undefined, @@ -735,11 +743,14 @@ describe('v1.ModelServiceClient', () => { client.importModelEvaluation(request), expectedError ); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation with closed client', async () => { @@ -751,7 +762,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ImportModelEvaluationRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -771,15 +786,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() ); @@ -787,11 +799,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchImportModelEvaluationSlices(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices without error using callback', async () => { @@ -803,15 +818,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() ); @@ -834,11 +846,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices with error', async () => { @@ -850,15 +865,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall( undefined, @@ -868,11 +880,14 @@ describe('v1.ModelServiceClient', () => { client.batchImportModelEvaluationSlices(request), expectedError ); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices with closed client', async () => { @@ -884,7 +899,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -904,15 +923,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -920,11 +935,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelEvaluation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation without error using callback', async () => { @@ -936,15 +954,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -967,11 +981,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation with error', async () => { @@ -983,26 +1000,25 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation with closed client', async () => { @@ -1014,7 +1030,10 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetModelEvaluationRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getModelEvaluation(request), expectedError); @@ -1031,15 +1050,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() ); @@ -1047,11 +1063,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelEvaluationSlice(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice without error using callback', async () => { @@ -1063,15 +1082,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() ); @@ -1094,11 +1110,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice with error', async () => { @@ -1110,15 +1129,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall( undefined, @@ -1128,11 +1144,14 @@ describe('v1.ModelServiceClient', () => { client.getModelEvaluationSlice(request), expectedError ); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice with closed client', async () => { @@ -1144,7 +1163,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetModelEvaluationSliceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1164,15 +1187,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1180,11 +1199,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel without error using callback', async () => { @@ -1196,15 +1218,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1234,11 +1252,14 @@ describe('v1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel with call error', async () => { @@ -1250,26 +1271,25 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel with LRO error', async () => { @@ -1281,15 +1301,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1298,11 +1314,14 @@ describe('v1.ModelServiceClient', () => { ); const [operation] = await client.uploadModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUploadModelProgress without error', async () => { @@ -1354,15 +1373,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1370,11 +1383,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel without error using callback', async () => { @@ -1386,15 +1402,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1424,11 +1434,14 @@ describe('v1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel with call error', async () => { @@ -1440,26 +1453,23 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel with LRO error', async () => { @@ -1471,15 +1481,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -1488,11 +1492,14 @@ describe('v1.ModelServiceClient', () => { ); const [operation] = await client.deleteModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelProgress without error', async () => { @@ -1544,15 +1551,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteModelVersionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1561,11 +1564,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion without error using callback', async () => { @@ -1577,15 +1583,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteModelVersionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1615,11 +1617,14 @@ describe('v1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion with call error', async () => { @@ -1631,26 +1636,25 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteModelVersionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion with LRO error', async () => { @@ -1662,15 +1666,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteModelVersionRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -1679,11 +1679,14 @@ describe('v1.ModelServiceClient', () => { ); const [operation] = await client.deleteModelVersion(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelVersionProgress without error', async () => { @@ -1738,15 +1741,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1754,11 +1751,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportModel without error using callback', async () => { @@ -1770,15 +1770,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1808,42 +1802,42 @@ describe('v1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); 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, - }, - }, - }; + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportModel with LRO error', async () => { @@ -1855,15 +1849,9 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -1872,11 +1860,14 @@ describe('v1.ModelServiceClient', () => { ); const [operation] = await client.exportModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportModelProgress without error', async () => { @@ -1928,15 +1919,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -1945,11 +1932,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModels without error using callback', async () => { @@ -1961,15 +1951,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -1994,11 +1980,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModels as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModels with error', async () => { @@ -2010,26 +1999,25 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelsStream without error', async () => { @@ -2041,8 +2029,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2073,11 +2064,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2090,8 +2082,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -2119,11 +2114,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2136,8 +2132,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2157,11 +2156,12 @@ describe('v1.ModelServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2174,8 +2174,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -2194,11 +2197,12 @@ describe('v1.ModelServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2213,15 +2217,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2230,11 +2230,14 @@ describe('v1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersions without error using callback', async () => { @@ -2246,15 +2249,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2279,11 +2278,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersions with error', async () => { @@ -2295,26 +2297,25 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersionsStream without error', async () => { @@ -2326,8 +2327,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2358,11 +2362,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2375,8 +2380,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2402,11 +2410,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2419,8 +2428,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2440,11 +2452,12 @@ describe('v1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2457,8 +2470,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2475,11 +2491,12 @@ describe('v1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2494,15 +2511,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -2518,11 +2531,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listModelEvaluations(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluations without error using callback', async () => { @@ -2534,15 +2550,11 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -2573,11 +2585,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluations with error', async () => { @@ -2589,26 +2604,25 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationsStream without error', async () => { @@ -2620,8 +2634,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -2659,11 +2676,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2676,8 +2694,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2704,11 +2725,12 @@ describe('v1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2721,8 +2743,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -2749,11 +2774,12 @@ describe('v1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2766,8 +2792,11 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2785,11 +2814,12 @@ describe('v1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2804,15 +2834,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -2828,11 +2855,14 @@ describe('v1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listModelEvaluationSlices(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlices without error using callback', async () => { @@ -2844,15 +2874,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -2885,11 +2912,14 @@ describe('v1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlices with error', async () => { @@ -2901,15 +2931,12 @@ describe('v1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall( undefined, @@ -2919,11 +2946,14 @@ describe('v1.ModelServiceClient', () => { client.listModelEvaluationSlices(request), expectedError ); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlicesStream without error', async () => { @@ -2935,8 +2965,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -2979,12 +3013,15 @@ describe('v1.ModelServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listModelEvaluationSlices, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2997,8 +3034,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3030,12 +3071,15 @@ describe('v1.ModelServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listModelEvaluationSlices, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3048,8 +3092,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -3077,12 +3125,15 @@ describe('v1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3095,8 +3146,12 @@ describe('v1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3115,12 +3170,15 @@ describe('v1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3595,12 +3653,15 @@ describe('v1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3631,12 +3692,15 @@ describe('v1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_model_service_v1beta1.ts b/test/gapic_model_service_v1beta1.ts index 9939b846..c58ed31d 100644 --- a/test/gapic_model_service_v1beta1.ts +++ b/test/gapic_model_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,23 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel without error using callback', async () => { @@ -291,15 +303,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -322,11 +328,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel with error', async () => { @@ -338,23 +347,20 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModel with closed client', async () => { @@ -366,7 +372,8 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetModelRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetModelRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getModel(request), expectedError); @@ -383,27 +390,27 @@ describe('v1beta1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel without error using callback', async () => { @@ -415,16 +422,13 @@ describe('v1beta1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -447,11 +451,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel with error', async () => { @@ -463,27 +470,27 @@ describe('v1beta1.ModelServiceClient', () => { 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, - }, - }, - }; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; + const expectedHeaderRequestParams = `model.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateModel with closed client', async () => { @@ -495,8 +502,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateModelRequest() ); - request.model = {}; - request.model.name = ''; + request.model ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateModelRequest', [ + 'model', + 'name', + ]); + request.model.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateModel(request), expectedError); @@ -513,15 +524,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -529,11 +536,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.mergeVersionAliases(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases without error using callback', async () => { @@ -545,15 +555,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -576,11 +582,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.mergeVersionAliases as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases with error', async () => { @@ -592,26 +601,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.mergeVersionAliases as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes mergeVersionAliases with closed client', async () => { @@ -623,7 +631,10 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MergeVersionAliasesRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('MergeVersionAliasesRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.mergeVersionAliases(request), expectedError); @@ -640,15 +651,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -656,11 +664,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.importModelEvaluation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation without error using callback', async () => { @@ -672,15 +683,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -703,11 +711,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation with error', async () => { @@ -719,15 +730,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.importModelEvaluation = stubSimpleCall( undefined, @@ -737,11 +745,14 @@ describe('v1beta1.ModelServiceClient', () => { client.importModelEvaluation(request), expectedError ); - assert( - (client.innerApiCalls.importModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes importModelEvaluation with closed client', async () => { @@ -753,7 +764,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ImportModelEvaluationRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'ImportModelEvaluationRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -773,15 +788,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() ); @@ -789,11 +801,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchImportModelEvaluationSlices(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices without error using callback', async () => { @@ -805,15 +820,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() ); @@ -836,11 +848,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices with error', async () => { @@ -852,15 +867,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall( undefined, @@ -870,11 +882,14 @@ describe('v1beta1.ModelServiceClient', () => { client.batchImportModelEvaluationSlices(request), expectedError ); - assert( - (client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchImportModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchImportModelEvaluationSlices with closed client', async () => { @@ -886,7 +901,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchImportModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -906,15 +925,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -922,11 +937,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelEvaluation(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation without error using callback', async () => { @@ -938,15 +956,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -969,11 +983,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluation as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation with error', async () => { @@ -985,26 +1002,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluation with closed client', async () => { @@ -1016,7 +1032,10 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetModelEvaluationRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getModelEvaluation(request), expectedError); @@ -1033,15 +1052,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() ); @@ -1049,11 +1065,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getModelEvaluationSlice(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice without error using callback', async () => { @@ -1065,15 +1084,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() ); @@ -1096,11 +1112,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice with error', async () => { @@ -1112,15 +1131,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall( undefined, @@ -1130,11 +1146,14 @@ describe('v1beta1.ModelServiceClient', () => { client.getModelEvaluationSlice(request), expectedError ); - assert( - (client.innerApiCalls.getModelEvaluationSlice as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModelEvaluationSlice as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getModelEvaluationSlice with closed client', async () => { @@ -1146,7 +1165,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetModelEvaluationSliceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetModelEvaluationSliceRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1166,15 +1189,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1182,11 +1201,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel without error using callback', async () => { @@ -1198,15 +1220,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1236,11 +1254,14 @@ describe('v1beta1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel with call error', async () => { @@ -1252,26 +1273,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes uploadModel with LRO error', async () => { @@ -1283,15 +1303,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('UploadModelRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1300,11 +1316,14 @@ describe('v1beta1.ModelServiceClient', () => { ); const [operation] = await client.uploadModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.uploadModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUploadModelProgress without error', async () => { @@ -1356,15 +1375,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1373,11 +1389,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExplanationDataset without error using callback', async () => { @@ -1389,15 +1408,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1427,11 +1443,14 @@ describe('v1beta1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExplanationDataset with call error', async () => { @@ -1443,15 +1462,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1461,11 +1477,14 @@ describe('v1beta1.ModelServiceClient', () => { client.updateExplanationDataset(request), expectedError ); - assert( - (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateExplanationDataset with LRO error', async () => { @@ -1477,15 +1496,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'UpdateExplanationDatasetRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1494,11 +1510,14 @@ describe('v1beta1.ModelServiceClient', () => { ); const [operation] = await client.updateExplanationDataset(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateExplanationDataset as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateExplanationDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateExplanationDatasetProgress without error', async () => { @@ -1554,15 +1573,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1570,11 +1583,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel without error using callback', async () => { @@ -1586,15 +1602,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1624,11 +1634,14 @@ describe('v1beta1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel with call error', async () => { @@ -1640,26 +1653,23 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModel with LRO error', async () => { @@ -1671,15 +1681,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -1688,11 +1692,14 @@ describe('v1beta1.ModelServiceClient', () => { ); const [operation] = await client.deleteModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelProgress without error', async () => { @@ -1744,15 +1751,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1761,11 +1764,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion without error using callback', async () => { @@ -1777,15 +1783,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1815,11 +1817,14 @@ describe('v1beta1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion with call error', async () => { @@ -1831,26 +1836,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteModelVersion with LRO error', async () => { @@ -1862,15 +1866,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteModelVersionRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -1879,11 +1879,14 @@ describe('v1beta1.ModelServiceClient', () => { ); const [operation] = await client.deleteModelVersion(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteModelVersion as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteModelVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteModelVersionProgress without error', async () => { @@ -1938,15 +1941,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1954,11 +1951,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportModel without error using callback', async () => { @@ -1970,15 +1970,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2008,42 +2002,42 @@ describe('v1beta1.ModelServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); 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, - }, - }, - }; + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ExportModelRequest() + ); + const defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportModel with LRO error', async () => { @@ -2055,15 +2049,9 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExportModelRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2072,11 +2060,14 @@ describe('v1beta1.ModelServiceClient', () => { ); const [operation] = await client.exportModel(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.exportModel as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkExportModelProgress without error', async () => { @@ -2128,15 +2119,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2151,11 +2138,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModels without error using callback', async () => { @@ -2167,15 +2157,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2206,11 +2192,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModels as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModels with error', async () => { @@ -2222,26 +2211,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelsStream without error', async () => { @@ -2253,8 +2241,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2291,11 +2282,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2308,8 +2300,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -2337,11 +2332,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2354,8 +2350,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2381,11 +2380,12 @@ describe('v1beta1.ModelServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2398,8 +2398,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -2418,11 +2421,12 @@ describe('v1beta1.ModelServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2437,15 +2441,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2460,11 +2460,14 @@ describe('v1beta1.ModelServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersions without error using callback', async () => { @@ -2476,15 +2479,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2515,11 +2514,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersions with error', async () => { @@ -2531,26 +2533,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelVersionsStream without error', async () => { @@ -2562,8 +2563,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2600,11 +2604,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2617,8 +2622,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2644,11 +2652,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2661,8 +2670,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2688,11 +2700,12 @@ describe('v1beta1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2705,8 +2718,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; + const defaultValue1 = getTypeDefaultValue('ListModelVersionsRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2723,11 +2739,12 @@ describe('v1beta1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2742,15 +2759,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -2766,11 +2779,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listModelEvaluations(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluations without error using callback', async () => { @@ -2782,15 +2798,11 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -2823,11 +2835,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluations as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluations with error', async () => { @@ -2839,26 +2854,25 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationsStream without error', async () => { @@ -2870,8 +2884,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -2911,11 +2928,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2928,8 +2946,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2958,11 +2979,12 @@ describe('v1beta1.ModelServiceClient', () => { .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 + assert( + (client.descriptors.page.listModelEvaluations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2975,8 +2997,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -3003,11 +3028,12 @@ describe('v1beta1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3020,8 +3046,11 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListModelEvaluationsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3039,11 +3068,12 @@ describe('v1beta1.ModelServiceClient', () => { ).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 + assert( + (client.descriptors.page.listModelEvaluations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3058,15 +3088,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3082,11 +3109,14 @@ describe('v1beta1.ModelServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listModelEvaluationSlices(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlices without error using callback', async () => { @@ -3098,15 +3128,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3139,11 +3166,14 @@ describe('v1beta1.ModelServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlices with error', async () => { @@ -3155,15 +3185,12 @@ describe('v1beta1.ModelServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall( undefined, @@ -3173,11 +3200,14 @@ describe('v1beta1.ModelServiceClient', () => { client.listModelEvaluationSlices(request), expectedError ); - assert( - (client.innerApiCalls.listModelEvaluationSlices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelEvaluationSlices as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listModelEvaluationSlicesStream without error', async () => { @@ -3189,8 +3219,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3233,12 +3267,15 @@ describe('v1beta1.ModelServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listModelEvaluationSlices, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3251,8 +3288,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3284,12 +3325,15 @@ describe('v1beta1.ModelServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listModelEvaluationSlices, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3302,8 +3346,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3331,12 +3379,15 @@ describe('v1beta1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3349,8 +3400,12 @@ describe('v1beta1.ModelServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListModelEvaluationSlicesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListModelEvaluationSlicesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3369,12 +3424,15 @@ describe('v1beta1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listModelEvaluationSlices .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3849,12 +3907,15 @@ describe('v1beta1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3885,12 +3946,15 @@ describe('v1beta1.ModelServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_pipeline_service_v1.ts b/test/gapic_pipeline_service_v1.ts index a751726a..34bf3190 100644 --- a/test/gapic_pipeline_service_v1.ts +++ b/test/gapic_pipeline_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,15 +275,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -276,11 +288,14 @@ describe('v1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline without error using callback', async () => { @@ -292,15 +307,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -323,11 +335,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline with error', async () => { @@ -339,15 +354,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrainingPipeline = stubSimpleCall( undefined, @@ -357,11 +369,14 @@ describe('v1.PipelineServiceClient', () => { client.createTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline with closed client', async () => { @@ -373,7 +388,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateTrainingPipelineRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -393,15 +412,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -409,11 +424,14 @@ describe('v1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline without error using callback', async () => { @@ -425,15 +443,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -456,11 +470,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline with error', async () => { @@ -472,26 +489,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline with closed client', async () => { @@ -503,7 +519,10 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTrainingPipelineRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTrainingPipeline(request), expectedError); @@ -520,15 +539,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -536,11 +552,14 @@ describe('v1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline without error using callback', async () => { @@ -552,15 +571,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -583,11 +599,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline with error', async () => { @@ -599,15 +618,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall( undefined, @@ -617,11 +633,14 @@ describe('v1.PipelineServiceClient', () => { client.cancelTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline with closed client', async () => { @@ -633,7 +652,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelTrainingPipelineRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -653,26 +676,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob without error using callback', async () => { @@ -684,15 +706,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -715,11 +733,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob with error', async () => { @@ -731,26 +752,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob with closed client', async () => { @@ -762,7 +782,10 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreatePipelineJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createPipelineJob(request), expectedError); @@ -779,26 +802,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob without error using callback', async () => { @@ -810,15 +832,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -841,11 +859,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob with error', async () => { @@ -857,26 +878,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob with closed client', async () => { @@ -888,7 +908,10 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetPipelineJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getPipelineJob(request), expectedError); @@ -905,26 +928,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob without error using callback', async () => { @@ -936,15 +958,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -967,11 +985,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob with error', async () => { @@ -983,26 +1004,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob with closed client', async () => { @@ -1014,7 +1034,10 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CancelPipelineJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.cancelPipelineJob(request), expectedError); @@ -1031,15 +1054,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1048,11 +1068,14 @@ describe('v1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline without error using callback', async () => { @@ -1064,15 +1087,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1102,11 +1122,14 @@ describe('v1.PipelineServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline with call error', async () => { @@ -1118,15 +1141,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1136,11 +1156,14 @@ describe('v1.PipelineServiceClient', () => { client.deleteTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline with LRO error', async () => { @@ -1152,15 +1175,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1169,11 +1189,14 @@ describe('v1.PipelineServiceClient', () => { ); const [operation] = await client.deleteTrainingPipeline(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTrainingPipelineProgress without error', async () => { @@ -1228,15 +1251,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1245,11 +1264,14 @@ describe('v1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob without error using callback', async () => { @@ -1261,15 +1283,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1299,11 +1317,14 @@ describe('v1.PipelineServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob with call error', async () => { @@ -1315,26 +1336,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob with LRO error', async () => { @@ -1346,15 +1366,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1363,11 +1379,14 @@ describe('v1.PipelineServiceClient', () => { ); const [operation] = await client.deletePipelineJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeletePipelineJobProgress without error', async () => { @@ -1422,15 +1441,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -1446,11 +1462,14 @@ describe('v1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTrainingPipelines(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelines without error using callback', async () => { @@ -1462,15 +1481,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -1503,11 +1519,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelines with error', async () => { @@ -1519,15 +1538,12 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrainingPipelines = stubSimpleCall( undefined, @@ -1537,11 +1553,14 @@ describe('v1.PipelineServiceClient', () => { client.listTrainingPipelines(request), expectedError ); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelinesStream without error', async () => { @@ -1553,8 +1572,12 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -1595,12 +1618,15 @@ describe('v1.PipelineServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTrainingPipelines, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1613,8 +1639,12 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1644,12 +1674,15 @@ describe('v1.PipelineServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTrainingPipelines, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1662,8 +1695,12 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -1691,12 +1728,15 @@ describe('v1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1709,8 +1749,12 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1729,12 +1773,15 @@ describe('v1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1749,15 +1796,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -1772,11 +1815,14 @@ describe('v1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobs without error using callback', async () => { @@ -1788,15 +1834,11 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -1827,11 +1869,14 @@ describe('v1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobs with error', async () => { @@ -1843,26 +1888,25 @@ describe('v1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobsStream without error', async () => { @@ -1874,8 +1918,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -1912,11 +1959,12 @@ describe('v1.PipelineServiceClient', () => { .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 + assert( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1929,8 +1977,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1956,11 +2007,12 @@ describe('v1.PipelineServiceClient', () => { .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 + assert( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1973,8 +2025,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -2000,11 +2055,12 @@ describe('v1.PipelineServiceClient', () => { ).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 + assert( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2017,8 +2073,11 @@ describe('v1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2035,11 +2094,12 @@ describe('v1.PipelineServiceClient', () => { ).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 + assert( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2514,12 +2574,15 @@ describe('v1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2550,12 +2613,15 @@ describe('v1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_pipeline_service_v1beta1.ts b/test/gapic_pipeline_service_v1beta1.ts index db654bda..059c1e05 100644 --- a/test/gapic_pipeline_service_v1beta1.ts +++ b/test/gapic_pipeline_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,15 +275,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -276,11 +288,14 @@ describe('v1beta1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline without error using callback', async () => { @@ -292,15 +307,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -323,11 +335,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline with error', async () => { @@ -339,15 +354,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrainingPipeline = stubSimpleCall( undefined, @@ -357,11 +369,14 @@ describe('v1beta1.PipelineServiceClient', () => { client.createTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.createTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrainingPipeline with closed client', async () => { @@ -373,7 +388,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateTrainingPipelineRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTrainingPipelineRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -393,15 +412,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -409,11 +424,14 @@ describe('v1beta1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline without error using callback', async () => { @@ -425,15 +443,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -456,11 +470,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline with error', async () => { @@ -472,26 +489,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrainingPipeline with closed client', async () => { @@ -503,7 +519,10 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTrainingPipelineRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTrainingPipelineRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTrainingPipeline(request), expectedError); @@ -520,15 +539,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -536,11 +552,14 @@ describe('v1beta1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.cancelTrainingPipeline(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline without error using callback', async () => { @@ -552,15 +571,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -583,11 +599,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline with error', async () => { @@ -599,15 +618,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall( undefined, @@ -617,11 +633,14 @@ describe('v1beta1.PipelineServiceClient', () => { client.cancelTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.cancelTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelTrainingPipeline with closed client', async () => { @@ -633,7 +652,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelTrainingPipelineRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'CancelTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -653,26 +676,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob without error using callback', async () => { @@ -684,15 +706,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -715,11 +733,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob with error', async () => { @@ -731,26 +752,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createPipelineJob with closed client', async () => { @@ -762,7 +782,10 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreatePipelineJobRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreatePipelineJobRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createPipelineJob(request), expectedError); @@ -779,26 +802,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob without error using callback', async () => { @@ -810,15 +832,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -841,11 +859,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob with error', async () => { @@ -857,26 +878,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPipelineJob with closed client', async () => { @@ -888,7 +908,10 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetPipelineJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getPipelineJob(request), expectedError); @@ -905,26 +928,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob without error using callback', async () => { @@ -936,15 +958,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -967,11 +985,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.cancelPipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob with error', async () => { @@ -983,26 +1004,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelPipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes cancelPipelineJob with closed client', async () => { @@ -1014,7 +1034,10 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CancelPipelineJobRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CancelPipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.cancelPipelineJob(request), expectedError); @@ -1031,15 +1054,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1048,11 +1068,14 @@ describe('v1beta1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline without error using callback', async () => { @@ -1064,15 +1087,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1102,11 +1122,14 @@ describe('v1beta1.PipelineServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline with call error', async () => { @@ -1118,15 +1141,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1136,11 +1156,14 @@ describe('v1beta1.PipelineServiceClient', () => { client.deleteTrainingPipeline(request), expectedError ); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrainingPipeline with LRO error', async () => { @@ -1152,15 +1175,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTrainingPipelineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1169,11 +1189,14 @@ describe('v1beta1.PipelineServiceClient', () => { ); const [operation] = await client.deleteTrainingPipeline(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTrainingPipeline as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrainingPipeline as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTrainingPipelineProgress without error', async () => { @@ -1228,15 +1251,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1245,11 +1264,14 @@ describe('v1beta1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob without error using callback', async () => { @@ -1261,15 +1283,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1299,11 +1317,14 @@ describe('v1beta1.PipelineServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob with call error', async () => { @@ -1315,26 +1336,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deletePipelineJob with LRO error', async () => { @@ -1346,15 +1366,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeletePipelineJobRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1363,11 +1379,14 @@ describe('v1beta1.PipelineServiceClient', () => { ); const [operation] = await client.deletePipelineJob(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deletePipelineJob as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePipelineJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeletePipelineJobProgress without error', async () => { @@ -1422,15 +1441,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -1446,11 +1462,14 @@ describe('v1beta1.PipelineServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTrainingPipelines(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelines without error using callback', async () => { @@ -1462,15 +1481,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -1503,11 +1519,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelines with error', async () => { @@ -1519,15 +1538,12 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrainingPipelines = stubSimpleCall( undefined, @@ -1537,11 +1553,14 @@ describe('v1beta1.PipelineServiceClient', () => { client.listTrainingPipelines(request), expectedError ); - assert( - (client.innerApiCalls.listTrainingPipelines as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrainingPipelines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrainingPipelinesStream without error', async () => { @@ -1553,8 +1572,12 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -1597,12 +1620,15 @@ describe('v1beta1.PipelineServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTrainingPipelines, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1615,8 +1641,12 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1648,12 +1678,15 @@ describe('v1beta1.PipelineServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTrainingPipelines, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1666,8 +1699,12 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -1695,12 +1732,15 @@ describe('v1beta1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1713,8 +1753,12 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrainingPipelinesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTrainingPipelinesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1733,12 +1777,15 @@ describe('v1beta1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTrainingPipelines .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1753,15 +1800,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -1776,11 +1819,14 @@ describe('v1beta1.PipelineServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobs without error using callback', async () => { @@ -1792,15 +1838,11 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -1833,11 +1875,14 @@ describe('v1beta1.PipelineServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listPipelineJobs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobs with error', async () => { @@ -1849,26 +1894,25 @@ describe('v1beta1.PipelineServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPipelineJobs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listPipelineJobsStream without error', async () => { @@ -1880,8 +1924,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -1919,11 +1966,12 @@ describe('v1beta1.PipelineServiceClient', () => { .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 + assert( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1936,8 +1984,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1964,11 +2015,12 @@ describe('v1beta1.PipelineServiceClient', () => { .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 + assert( + (client.descriptors.page.listPipelineJobs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1981,8 +2033,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -2009,11 +2064,12 @@ describe('v1beta1.PipelineServiceClient', () => { ).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 + assert( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2026,8 +2082,11 @@ describe('v1beta1.PipelineServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListPipelineJobsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListPipelineJobsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2045,11 +2104,12 @@ describe('v1beta1.PipelineServiceClient', () => { ).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 + assert( + (client.descriptors.page.listPipelineJobs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2524,12 +2584,15 @@ describe('v1beta1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -2560,12 +2623,15 @@ describe('v1beta1.PipelineServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_prediction_service_v1.ts b/test/gapic_prediction_service_v1.ts index be5d8d5c..15792681 100644 --- a/test/gapic_prediction_service_v1.ts +++ b/test/gapic_prediction_service_v1.ts @@ -30,6 +30,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -187,26 +202,23 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict without error using callback', async () => { @@ -218,15 +230,9 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PredictResponse() ); @@ -249,11 +255,14 @@ describe('v1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.predict as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict with error', async () => { @@ -265,23 +274,20 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict with closed client', async () => { @@ -293,7 +299,8 @@ describe('v1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PredictRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.predict(request), expectedError); @@ -310,26 +317,25 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict without error using callback', async () => { @@ -341,15 +347,11 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -369,11 +371,14 @@ describe('v1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict with error', async () => { @@ -385,26 +390,25 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict with closed client', async () => { @@ -416,7 +420,10 @@ describe('v1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RawPredictRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.rawPredict(request), expectedError); @@ -433,26 +440,23 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain without error using callback', async () => { @@ -464,15 +468,9 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExplainResponse() ); @@ -495,11 +493,14 @@ describe('v1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.explain as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain with error', async () => { @@ -511,23 +512,20 @@ describe('v1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain with closed client', async () => { @@ -539,7 +537,8 @@ describe('v1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExplainRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.explain(request), expectedError); @@ -1016,12 +1015,15 @@ describe('v1.PredictionServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1052,12 +1054,15 @@ describe('v1.PredictionServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_prediction_service_v1beta1.ts b/test/gapic_prediction_service_v1beta1.ts index 6ee97a53..d442dcea 100644 --- a/test/gapic_prediction_service_v1beta1.ts +++ b/test/gapic_prediction_service_v1beta1.ts @@ -30,6 +30,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -195,26 +210,23 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict without error using callback', async () => { @@ -227,15 +239,9 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PredictResponse() ); @@ -258,11 +264,14 @@ describe('v1beta1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.predict as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict with error', async () => { @@ -275,23 +284,20 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes predict with closed client', async () => { @@ -304,7 +310,8 @@ describe('v1beta1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PredictRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('PredictRequest', ['endpoint']); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.predict(request), expectedError); @@ -322,26 +329,25 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict without error using callback', async () => { @@ -354,15 +360,11 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -382,11 +384,14 @@ describe('v1beta1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.rawPredict as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict with error', async () => { @@ -399,26 +404,25 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rawPredict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes rawPredict with closed client', async () => { @@ -431,7 +435,10 @@ describe('v1beta1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RawPredictRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('RawPredictRequest', [ + 'endpoint', + ]); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.rawPredict(request), expectedError); @@ -449,26 +456,23 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain without error using callback', async () => { @@ -481,15 +485,9 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExplainResponse() ); @@ -512,11 +510,14 @@ describe('v1beta1.PredictionServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.explain as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain with error', async () => { @@ -529,23 +530,20 @@ describe('v1beta1.PredictionServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; + const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; 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) - ); + const actualRequest = (client.innerApiCalls.explain as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.explain as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes explain with closed client', async () => { @@ -558,7 +556,8 @@ describe('v1beta1.PredictionServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExplainRequest() ); - request.endpoint = ''; + const defaultValue1 = getTypeDefaultValue('ExplainRequest', ['endpoint']); + request.endpoint = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.explain(request), expectedError); @@ -1048,12 +1047,15 @@ describe('v1beta1.PredictionServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1085,12 +1087,15 @@ describe('v1beta1.PredictionServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_specialist_pool_service_v1.ts b/test/gapic_specialist_pool_service_v1.ts index 22821057..c1c91378 100644 --- a/test/gapic_specialist_pool_service_v1.ts +++ b/test/gapic_specialist_pool_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -269,26 +284,25 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool without error using callback', async () => { @@ -301,15 +315,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() ); @@ -332,11 +342,14 @@ describe('v1.SpecialistPoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool with error', async () => { @@ -349,26 +362,25 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool with closed client', async () => { @@ -381,7 +393,10 @@ describe('v1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetSpecialistPoolRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSpecialistPool(request), expectedError); @@ -399,15 +414,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -416,11 +427,14 @@ describe('v1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool without error using callback', async () => { @@ -433,15 +447,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -471,11 +481,14 @@ describe('v1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool with call error', async () => { @@ -488,26 +501,25 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool with LRO error', async () => { @@ -520,15 +532,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -537,11 +545,14 @@ describe('v1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.createSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateSpecialistPoolProgress without error', async () => { @@ -599,15 +610,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -616,11 +623,14 @@ describe('v1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool without error using callback', async () => { @@ -633,15 +643,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -671,11 +677,14 @@ describe('v1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool with call error', async () => { @@ -688,26 +697,25 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool with LRO error', async () => { @@ -720,15 +728,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -737,11 +741,14 @@ describe('v1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.deleteSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteSpecialistPoolProgress without error', async () => { @@ -799,16 +806,13 @@ describe('v1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -817,11 +821,14 @@ describe('v1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool without error using callback', async () => { @@ -834,16 +841,13 @@ describe('v1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -873,11 +877,14 @@ describe('v1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool with call error', async () => { @@ -890,27 +897,27 @@ describe('v1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool with LRO error', async () => { @@ -923,16 +930,13 @@ describe('v1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -941,11 +945,14 @@ describe('v1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.updateSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateSpecialistPoolProgress without error', async () => { @@ -1003,15 +1010,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1027,11 +1030,14 @@ describe('v1.SpecialistPoolServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listSpecialistPools(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPools without error using callback', async () => { @@ -1044,15 +1050,11 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1083,11 +1085,14 @@ describe('v1.SpecialistPoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPools with error', async () => { @@ -1100,26 +1105,25 @@ describe('v1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPoolsStream without error', async () => { @@ -1132,8 +1136,11 @@ describe('v1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1171,11 +1178,12 @@ describe('v1.SpecialistPoolServiceClient', () => { .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 + assert( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1189,8 +1197,11 @@ describe('v1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1217,11 +1228,12 @@ describe('v1.SpecialistPoolServiceClient', () => { .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 + assert( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1235,8 +1247,11 @@ describe('v1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1262,11 +1277,12 @@ describe('v1.SpecialistPoolServiceClient', () => { ).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 + assert( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1280,8 +1296,11 @@ describe('v1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1299,11 +1318,12 @@ describe('v1.SpecialistPoolServiceClient', () => { ).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 + assert( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1791,12 +1811,15 @@ describe('v1.SpecialistPoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1828,12 +1851,15 @@ describe('v1.SpecialistPoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_specialist_pool_service_v1beta1.ts b/test/gapic_specialist_pool_service_v1beta1.ts index 431440ed..6317c3d7 100644 --- a/test/gapic_specialist_pool_service_v1beta1.ts +++ b/test/gapic_specialist_pool_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -271,26 +286,25 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool without error using callback', async () => { @@ -303,15 +317,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() ); @@ -334,11 +344,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool with error', async () => { @@ -351,26 +364,25 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSpecialistPool with closed client', async () => { @@ -383,7 +395,10 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetSpecialistPoolRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSpecialistPool(request), expectedError); @@ -401,15 +416,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -418,11 +429,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool without error using callback', async () => { @@ -435,15 +449,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -473,11 +483,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool with call error', async () => { @@ -490,26 +503,25 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createSpecialistPool with LRO error', async () => { @@ -522,15 +534,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateSpecialistPoolRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -539,11 +547,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.createSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateSpecialistPoolProgress without error', async () => { @@ -601,15 +612,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -618,11 +625,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool without error using callback', async () => { @@ -635,15 +645,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -673,11 +679,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool with call error', async () => { @@ -690,26 +699,25 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteSpecialistPool with LRO error', async () => { @@ -722,15 +730,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteSpecialistPoolRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -739,11 +743,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.deleteSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteSpecialistPoolProgress without error', async () => { @@ -801,16 +808,13 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -819,11 +823,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool without error using callback', async () => { @@ -836,16 +843,13 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -875,11 +879,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool with call error', async () => { @@ -892,27 +899,27 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateSpecialistPool with LRO error', async () => { @@ -925,16 +932,13 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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, - }, - }, - }; + request.specialistPool ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateSpecialistPoolRequest', [ + 'specialistPool', + 'name', + ]); + request.specialistPool.name = defaultValue1; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -943,11 +947,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ); const [operation] = await client.updateSpecialistPool(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateSpecialistPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpecialistPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateSpecialistPoolProgress without error', async () => { @@ -1005,15 +1012,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1029,11 +1032,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listSpecialistPools(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPools without error using callback', async () => { @@ -1046,15 +1052,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1087,11 +1089,14 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listSpecialistPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPools with error', async () => { @@ -1104,26 +1109,25 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpecialistPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listSpecialistPoolsStream without error', async () => { @@ -1136,8 +1140,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1175,11 +1182,12 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { .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 + assert( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1193,8 +1201,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1221,11 +1232,12 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { .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 + assert( + (client.descriptors.page.listSpecialistPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1239,8 +1251,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1267,11 +1282,12 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ).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 + assert( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1285,8 +1301,11 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListSpecialistPoolsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListSpecialistPoolsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1304,11 +1323,12 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ).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 + assert( + (client.descriptors.page.listSpecialistPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1796,12 +1816,15 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -1833,12 +1856,15 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_tensorboard_service_v1.ts b/test/gapic_tensorboard_service_v1.ts index 275f41c8..b02dfee5 100644 --- a/test/gapic_tensorboard_service_v1.ts +++ b/test/gapic_tensorboard_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -281,26 +296,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard without error using callback', async () => { @@ -312,15 +326,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() ); @@ -343,11 +353,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard with error', async () => { @@ -359,26 +372,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard with closed client', async () => { @@ -390,7 +402,10 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTensorboardRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTensorboard(request), expectedError); @@ -407,15 +422,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -423,11 +435,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment without error using callback', async () => { @@ -439,15 +454,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -470,11 +482,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment with error', async () => { @@ -486,15 +501,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardExperiment = stubSimpleCall( undefined, @@ -504,11 +516,14 @@ describe('v1.TensorboardServiceClient', () => { client.createTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment with closed client', async () => { @@ -520,7 +535,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -540,15 +559,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -556,11 +572,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment without error using callback', async () => { @@ -572,15 +591,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -603,11 +619,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment with error', async () => { @@ -619,15 +638,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardExperiment = stubSimpleCall( undefined, @@ -637,11 +653,14 @@ describe('v1.TensorboardServiceClient', () => { client.getTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment with closed client', async () => { @@ -653,7 +672,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -673,16 +696,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -690,11 +710,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment without error using callback', async () => { @@ -706,16 +729,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -738,11 +758,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment with error', async () => { @@ -754,16 +777,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall( undefined, @@ -773,11 +793,14 @@ describe('v1.TensorboardServiceClient', () => { client.updateTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment with closed client', async () => { @@ -789,8 +812,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest() ); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -810,15 +837,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -826,11 +849,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardRun(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun without error using callback', async () => { @@ -842,15 +868,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -873,11 +895,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun with error', async () => { @@ -889,26 +914,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun with closed client', async () => { @@ -920,7 +944,10 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateTensorboardRunRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createTensorboardRun(request), expectedError); @@ -937,15 +964,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse() ); @@ -953,11 +977,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCreateTensorboardRuns(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns without error using callback', async () => { @@ -969,15 +996,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse() ); @@ -1000,11 +1024,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns with error', async () => { @@ -1016,15 +1043,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall( undefined, @@ -1034,11 +1058,14 @@ describe('v1.TensorboardServiceClient', () => { client.batchCreateTensorboardRuns(request), expectedError ); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns with closed client', async () => { @@ -1050,7 +1077,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1070,26 +1101,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun without error using callback', async () => { @@ -1101,15 +1131,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1132,11 +1158,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun with error', async () => { @@ -1148,26 +1177,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun with closed client', async () => { @@ -1179,7 +1207,10 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTensorboardRunRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTensorboardRun(request), expectedError); @@ -1196,16 +1227,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1213,11 +1241,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardRun(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun without error using callback', async () => { @@ -1229,16 +1260,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1261,11 +1289,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun with error', async () => { @@ -1277,27 +1308,27 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun with closed client', async () => { @@ -1309,8 +1340,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest() ); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateTensorboardRun(request), expectedError); @@ -1327,15 +1362,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1343,11 +1375,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCreateTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { @@ -1359,15 +1394,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1390,11 +1422,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries with error', async () => { @@ -1406,15 +1441,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1424,11 +1456,14 @@ describe('v1.TensorboardServiceClient', () => { client.batchCreateTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { @@ -1440,7 +1475,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1460,15 +1499,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1476,11 +1512,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries without error using callback', async () => { @@ -1492,15 +1531,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1523,11 +1559,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries with error', async () => { @@ -1539,15 +1578,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1557,11 +1593,14 @@ describe('v1.TensorboardServiceClient', () => { client.createTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries with closed client', async () => { @@ -1573,7 +1612,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1593,15 +1636,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1609,11 +1649,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries without error using callback', async () => { @@ -1625,15 +1668,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1656,11 +1696,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries with error', async () => { @@ -1672,15 +1715,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1690,11 +1730,14 @@ describe('v1.TensorboardServiceClient', () => { client.getTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries with closed client', async () => { @@ -1706,7 +1749,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1726,16 +1773,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1743,11 +1787,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries without error using callback', async () => { @@ -1759,16 +1806,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1791,11 +1835,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries with error', async () => { @@ -1807,16 +1854,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1826,11 +1870,14 @@ describe('v1.TensorboardServiceClient', () => { client.updateTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries with closed client', async () => { @@ -1842,8 +1889,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest() ); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1863,15 +1914,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -1881,11 +1929,14 @@ describe('v1.TensorboardServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { @@ -1897,15 +1948,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -1928,11 +1976,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData with error', async () => { @@ -1944,15 +1995,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -1962,11 +2010,14 @@ describe('v1.TensorboardServiceClient', () => { client.batchReadTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { @@ -1978,7 +2029,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest() ); - request.tensorboard = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1998,15 +2053,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2014,11 +2066,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.readTensorboardTimeSeriesData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData without error using callback', async () => { @@ -2030,15 +2085,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2061,11 +2113,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData with error', async () => { @@ -2077,15 +2132,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2095,11 +2147,14 @@ describe('v1.TensorboardServiceClient', () => { client.readTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData with closed client', async () => { @@ -2111,7 +2166,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; + const defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2131,15 +2190,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse() ); @@ -2147,11 +2203,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.writeTensorboardExperimentData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData without error using callback', async () => { @@ -2163,15 +2222,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse() ); @@ -2194,11 +2250,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData with error', async () => { @@ -2210,15 +2269,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall( undefined, @@ -2228,11 +2284,14 @@ describe('v1.TensorboardServiceClient', () => { client.writeTensorboardExperimentData(request), expectedError ); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData with closed client', async () => { @@ -2244,7 +2303,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest() ); - request.tensorboardExperiment = ''; + const defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2264,15 +2327,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse() ); @@ -2280,11 +2340,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.writeTensorboardRunData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData without error using callback', async () => { @@ -2296,15 +2359,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse() ); @@ -2327,11 +2387,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData with error', async () => { @@ -2343,15 +2406,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardRunData = stubSimpleCall( undefined, @@ -2361,11 +2421,14 @@ describe('v1.TensorboardServiceClient', () => { client.writeTensorboardRunData(request), expectedError ); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData with closed client', async () => { @@ -2377,7 +2440,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest() ); - request.tensorboardRun = ''; + const defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2397,15 +2464,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2414,11 +2477,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard without error using callback', async () => { @@ -2430,15 +2496,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2468,11 +2530,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard with call error', async () => { @@ -2484,26 +2549,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard with LRO error', async () => { @@ -2515,15 +2579,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -2532,11 +2592,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.createTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateTensorboardProgress without error', async () => { @@ -2591,16 +2654,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2609,11 +2669,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard without error using callback', async () => { @@ -2625,16 +2688,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2664,11 +2724,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard with call error', async () => { @@ -2680,27 +2743,27 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard with LRO error', async () => { @@ -2712,16 +2775,13 @@ describe('v1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -2730,11 +2790,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.updateTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateTensorboardProgress without error', async () => { @@ -2789,15 +2852,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2806,11 +2865,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard without error using callback', async () => { @@ -2822,15 +2884,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2860,11 +2918,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard with call error', async () => { @@ -2876,26 +2937,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard with LRO error', async () => { @@ -2907,15 +2967,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -2924,11 +2980,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardProgress without error', async () => { @@ -2983,15 +3042,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3000,11 +3056,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment without error using callback', async () => { @@ -3016,15 +3075,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3054,11 +3110,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment with call error', async () => { @@ -3070,15 +3129,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3088,11 +3144,14 @@ describe('v1.TensorboardServiceClient', () => { client.deleteTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment with LRO error', async () => { @@ -3104,15 +3163,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3121,11 +3177,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardExperiment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { @@ -3181,15 +3240,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3198,11 +3253,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun without error using callback', async () => { @@ -3214,15 +3272,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3252,11 +3306,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun with call error', async () => { @@ -3268,26 +3325,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun with LRO error', async () => { @@ -3299,15 +3355,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3316,11 +3368,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardRun(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardRunProgress without error', async () => { @@ -3375,15 +3430,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3392,11 +3444,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries without error using callback', async () => { @@ -3408,15 +3463,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3446,11 +3498,14 @@ describe('v1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries with call error', async () => { @@ -3462,15 +3517,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3480,11 +3532,14 @@ describe('v1.TensorboardServiceClient', () => { client.deleteTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries with LRO error', async () => { @@ -3496,15 +3551,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3513,11 +3565,14 @@ describe('v1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardTimeSeries(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { @@ -3573,15 +3628,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse() ); @@ -3603,11 +3655,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardBlobData with error', async () => { @@ -3619,15 +3674,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall( undefined, @@ -3648,11 +3700,14 @@ describe('v1.TensorboardServiceClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardBlobData with closed client', async () => { @@ -3664,7 +3719,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest() ); - request.timeSeries = ''; + const defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.readTensorboardBlobData(request); @@ -3695,15 +3754,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -3718,11 +3773,14 @@ describe('v1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboards without error using callback', async () => { @@ -3734,15 +3792,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -3773,11 +3827,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboards with error', async () => { @@ -3789,26 +3846,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardsStream without error', async () => { @@ -3820,8 +3876,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -3858,11 +3917,12 @@ describe('v1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3875,8 +3935,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3902,11 +3965,12 @@ describe('v1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3919,8 +3983,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -3946,11 +4013,12 @@ describe('v1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3963,8 +4031,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3981,11 +4052,12 @@ describe('v1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4000,15 +4072,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4024,11 +4093,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardExperiments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperiments without error using callback', async () => { @@ -4040,15 +4112,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4081,11 +4150,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperiments with error', async () => { @@ -4097,15 +4169,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardExperiments = stubSimpleCall( undefined, @@ -4115,11 +4184,14 @@ describe('v1.TensorboardServiceClient', () => { client.listTensorboardExperiments(request), expectedError ); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperimentsStream without error', async () => { @@ -4131,8 +4203,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4175,12 +4251,15 @@ describe('v1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardExperiments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4193,8 +4272,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4226,12 +4309,15 @@ describe('v1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardExperiments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4244,8 +4330,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4273,12 +4363,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4291,8 +4384,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4311,12 +4408,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4331,15 +4431,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4355,11 +4451,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardRuns(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRuns without error using callback', async () => { @@ -4371,15 +4470,11 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4410,11 +4505,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRuns with error', async () => { @@ -4426,26 +4524,25 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRunsStream without error', async () => { @@ -4457,8 +4554,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4496,11 +4596,12 @@ describe('v1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4513,8 +4614,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4541,11 +4645,12 @@ describe('v1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4558,8 +4663,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4585,11 +4693,12 @@ describe('v1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4602,8 +4711,11 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4621,11 +4733,12 @@ describe('v1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4640,15 +4753,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -4664,11 +4774,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeries without error using callback', async () => { @@ -4680,15 +4793,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -4721,11 +4831,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeries with error', async () => { @@ -4737,15 +4850,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall( undefined, @@ -4755,11 +4865,14 @@ describe('v1.TensorboardServiceClient', () => { client.listTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeriesStream without error', async () => { @@ -4771,8 +4884,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -4815,12 +4932,15 @@ describe('v1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardTimeSeries, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4833,8 +4953,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4866,12 +4990,15 @@ describe('v1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardTimeSeries, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4884,8 +5011,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -4913,12 +5044,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4931,8 +5065,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4951,12 +5089,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4971,15 +5112,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -4995,11 +5133,14 @@ describe('v1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.exportTensorboardTimeSeriesData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { @@ -5011,15 +5152,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5052,11 +5190,14 @@ describe('v1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesData with error', async () => { @@ -5068,15 +5209,12 @@ describe('v1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -5086,11 +5224,14 @@ describe('v1.TensorboardServiceClient', () => { client.exportTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { @@ -5102,8 +5243,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5147,12 +5292,15 @@ describe('v1.TensorboardServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5165,8 +5313,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5199,12 +5351,15 @@ describe('v1.TensorboardServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5217,8 +5372,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5246,12 +5405,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5264,8 +5426,12 @@ describe('v1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5284,12 +5450,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5764,12 +5933,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -5800,12 +5972,15 @@ describe('v1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_tensorboard_service_v1beta1.ts b/test/gapic_tensorboard_service_v1beta1.ts index 21453295..33863022 100644 --- a/test/gapic_tensorboard_service_v1beta1.ts +++ b/test/gapic_tensorboard_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -290,26 +305,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard without error using callback', async () => { @@ -322,15 +336,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() ); @@ -353,11 +363,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard with error', async () => { @@ -370,26 +383,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboard with closed client', async () => { @@ -402,7 +414,10 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTensorboard(request), expectedError); @@ -420,15 +435,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -436,11 +448,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment without error using callback', async () => { @@ -453,15 +468,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -484,11 +496,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment with error', async () => { @@ -501,15 +516,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardExperiment = stubSimpleCall( undefined, @@ -519,11 +531,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.createTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.createTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardExperiment with closed client', async () => { @@ -536,7 +551,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardExperimentRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardExperimentRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -557,15 +576,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -573,11 +589,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment without error using callback', async () => { @@ -590,15 +609,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -621,11 +637,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment with error', async () => { @@ -638,15 +657,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardExperiment = stubSimpleCall( undefined, @@ -656,11 +672,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.getTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.getTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardExperiment with closed client', async () => { @@ -673,7 +692,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTensorboardExperimentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -694,16 +717,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -711,11 +731,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardExperiment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment without error using callback', async () => { @@ -728,16 +751,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -760,11 +780,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment with error', async () => { @@ -777,16 +800,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall( undefined, @@ -796,11 +816,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.updateTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.updateTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardExperiment with closed client', async () => { @@ -813,8 +836,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardExperimentRequest() ); - request.tensorboardExperiment = {}; - request.tensorboardExperiment.name = ''; + request.tensorboardExperiment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardExperimentRequest', + ['tensorboardExperiment', 'name'] + ); + request.tensorboardExperiment.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -835,15 +862,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -851,11 +874,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardRun(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun without error using callback', async () => { @@ -868,15 +894,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -899,11 +921,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun with error', async () => { @@ -916,26 +941,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardRun with closed client', async () => { @@ -948,7 +972,10 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardRunRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateTensorboardRunRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createTensorboardRun(request), expectedError); @@ -966,15 +993,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse() ); @@ -982,11 +1006,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCreateTensorboardRuns(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns without error using callback', async () => { @@ -999,15 +1026,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse() ); @@ -1030,11 +1054,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns with error', async () => { @@ -1047,15 +1074,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall( undefined, @@ -1065,11 +1089,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.batchCreateTensorboardRuns(request), expectedError ); - assert( - (client.innerApiCalls.batchCreateTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardRuns with closed client', async () => { @@ -1082,7 +1109,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardRunsRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1103,26 +1134,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun without error using callback', async () => { @@ -1135,15 +1165,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1166,11 +1192,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun with error', async () => { @@ -1183,26 +1212,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardRun with closed client', async () => { @@ -1215,7 +1243,10 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTensorboardRunRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTensorboardRun(request), expectedError); @@ -1233,16 +1264,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1250,11 +1278,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardRun(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun without error using callback', async () => { @@ -1267,16 +1298,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1299,11 +1327,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun with error', async () => { @@ -1316,27 +1347,27 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardRun with closed client', async () => { @@ -1349,8 +1380,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardRunRequest() ); - request.tensorboardRun = {}; - request.tensorboardRun.name = ''; + request.tensorboardRun ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRunRequest', [ + 'tensorboardRun', + 'name', + ]); + request.tensorboardRun.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateTensorboardRun(request), expectedError); @@ -1368,15 +1403,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1384,11 +1416,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.batchCreateTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries without error using callback', async () => { @@ -1401,15 +1436,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1432,11 +1464,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries with error', async () => { @@ -1449,15 +1484,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1467,11 +1499,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.batchCreateTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchCreateTensorboardTimeSeries with closed client', async () => { @@ -1484,7 +1519,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchCreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1505,15 +1544,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1521,11 +1557,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.createTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries without error using callback', async () => { @@ -1538,15 +1577,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1569,11 +1605,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries with error', async () => { @@ -1586,15 +1625,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1604,11 +1640,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.createTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.createTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboardTimeSeries with closed client', async () => { @@ -1621,7 +1660,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateTensorboardTimeSeriesRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'CreateTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1642,15 +1685,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1658,11 +1698,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries without error using callback', async () => { @@ -1675,15 +1718,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1706,11 +1746,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries with error', async () => { @@ -1723,15 +1766,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1741,11 +1781,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.getTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.getTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTensorboardTimeSeries with closed client', async () => { @@ -1758,7 +1801,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTensorboardTimeSeriesRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1779,16 +1826,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1796,11 +1840,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.updateTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries without error using callback', async () => { @@ -1813,16 +1860,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1845,11 +1889,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries with error', async () => { @@ -1862,16 +1909,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1881,11 +1925,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.updateTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.updateTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboardTimeSeries with closed client', async () => { @@ -1898,8 +1945,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpdateTensorboardTimeSeriesRequest() ); - request.tensorboardTimeSeries = {}; - request.tensorboardTimeSeries.name = ''; + request.tensorboardTimeSeries ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateTensorboardTimeSeriesRequest', + ['tensorboardTimeSeries', 'name'] + ); + request.tensorboardTimeSeries.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -1920,15 +1971,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -1938,11 +1986,14 @@ describe('v1beta1.TensorboardServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData without error using callback', async () => { @@ -1955,15 +2006,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -1986,11 +2034,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData with error', async () => { @@ -2003,15 +2054,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2021,11 +2069,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.batchReadTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchReadTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes batchReadTensorboardTimeSeriesData with closed client', async () => { @@ -2038,7 +2089,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataRequest() ); - request.tensorboard = ''; + const defaultValue1 = getTypeDefaultValue( + 'BatchReadTensorboardTimeSeriesDataRequest', + ['tensorboard'] + ); + request.tensorboard = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2059,15 +2114,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2075,11 +2127,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.readTensorboardTimeSeriesData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData without error using callback', async () => { @@ -2092,15 +2147,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2123,11 +2175,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData with error', async () => { @@ -2140,15 +2195,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2158,11 +2210,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.readTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardTimeSeriesData with closed client', async () => { @@ -2175,7 +2230,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; + const defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2196,15 +2255,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse() ); @@ -2212,11 +2268,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.writeTensorboardExperimentData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData without error using callback', async () => { @@ -2229,15 +2288,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse() ); @@ -2260,11 +2316,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData with error', async () => { @@ -2277,15 +2336,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall( undefined, @@ -2295,11 +2351,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.writeTensorboardExperimentData(request), expectedError ); - assert( - (client.innerApiCalls.writeTensorboardExperimentData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardExperimentData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardExperimentData with closed client', async () => { @@ -2312,7 +2371,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataRequest() ); - request.tensorboardExperiment = ''; + const defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardExperimentDataRequest', + ['tensorboardExperiment'] + ); + request.tensorboardExperiment = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2333,15 +2396,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse() ); @@ -2349,11 +2409,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.writeTensorboardRunData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData without error using callback', async () => { @@ -2366,15 +2429,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse() ); @@ -2397,11 +2457,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData with error', async () => { @@ -2414,15 +2477,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardRunData = stubSimpleCall( undefined, @@ -2432,11 +2492,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.writeTensorboardRunData(request), expectedError ); - assert( - (client.innerApiCalls.writeTensorboardRunData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.writeTensorboardRunData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes writeTensorboardRunData with closed client', async () => { @@ -2449,7 +2512,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataRequest() ); - request.tensorboardRun = ''; + const defaultValue1 = getTypeDefaultValue( + 'WriteTensorboardRunDataRequest', + ['tensorboardRun'] + ); + request.tensorboardRun = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -2470,15 +2537,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2487,11 +2550,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard without error using callback', async () => { @@ -2504,15 +2570,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2542,11 +2604,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard with call error', async () => { @@ -2559,26 +2624,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTensorboard with LRO error', async () => { @@ -2591,15 +2655,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTensorboardRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -2608,11 +2668,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.createTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateTensorboardProgress without error', async () => { @@ -2670,16 +2733,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2688,11 +2748,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard without error using callback', async () => { @@ -2705,16 +2768,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2744,11 +2804,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard with call error', async () => { @@ -2761,27 +2824,27 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateTensorboard with LRO error', async () => { @@ -2794,16 +2857,13 @@ describe('v1beta1.TensorboardServiceClient', () => { 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, - }, - }, - }; + request.tensorboard ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateTensorboardRequest', [ + 'tensorboard', + 'name', + ]); + request.tensorboard.name = defaultValue1; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -2812,11 +2872,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.updateTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateTensorboardProgress without error', async () => { @@ -2874,15 +2937,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2891,11 +2950,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard without error using callback', async () => { @@ -2908,15 +2970,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2946,11 +3004,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard with call error', async () => { @@ -2963,26 +3024,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboard with LRO error', async () => { @@ -2995,15 +3055,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -3012,11 +3068,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboard(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboard as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboard as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardProgress without error', async () => { @@ -3074,15 +3133,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3091,11 +3147,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment without error using callback', async () => { @@ -3108,15 +3167,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3146,11 +3202,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment with call error', async () => { @@ -3163,15 +3222,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3181,11 +3237,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.deleteTensorboardExperiment(request), expectedError ); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardExperiment with LRO error', async () => { @@ -3198,15 +3257,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardExperimentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3215,11 +3271,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardExperiment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardExperiment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardExperiment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardExperimentProgress without error', async () => { @@ -3278,15 +3337,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3295,11 +3350,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun without error using callback', async () => { @@ -3312,15 +3370,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3350,11 +3404,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun with call error', async () => { @@ -3367,26 +3424,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardRun with LRO error', async () => { @@ -3399,15 +3455,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTensorboardRunRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3416,11 +3468,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardRun(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardRun as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardRun as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardRunProgress without error', async () => { @@ -3478,15 +3533,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3495,11 +3547,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries without error using callback', async () => { @@ -3512,15 +3567,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3550,11 +3602,14 @@ describe('v1beta1.TensorboardServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries with call error', async () => { @@ -3567,15 +3622,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3585,11 +3637,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.deleteTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTensorboardTimeSeries with LRO error', async () => { @@ -3602,15 +3657,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'DeleteTensorboardTimeSeriesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3619,11 +3671,14 @@ describe('v1beta1.TensorboardServiceClient', () => { ); const [operation] = await client.deleteTensorboardTimeSeries(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteTensorboardTimeSeriesProgress without error', async () => { @@ -3682,15 +3737,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse() ); @@ -3712,11 +3764,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardBlobData with error', async () => { @@ -3729,15 +3784,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; + const expectedHeaderRequestParams = `time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall( undefined, @@ -3758,11 +3810,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); }); await assert.rejects(promise, expectedError); - assert( - (client.innerApiCalls.readTensorboardBlobData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions) - ); + const actualRequest = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.readTensorboardBlobData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes readTensorboardBlobData with closed client', async () => { @@ -3775,7 +3830,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataRequest() ); - request.timeSeries = ''; + const defaultValue1 = getTypeDefaultValue( + 'ReadTensorboardBlobDataRequest', + ['timeSeries'] + ); + request.timeSeries = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); const stream = client.readTensorboardBlobData(request); @@ -3807,15 +3866,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -3830,11 +3885,14 @@ describe('v1beta1.TensorboardServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboards without error using callback', async () => { @@ -3847,15 +3905,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -3888,11 +3942,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboards as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboards with error', async () => { @@ -3905,26 +3962,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboards as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardsStream without error', async () => { @@ -3937,8 +3993,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -3976,11 +4035,12 @@ describe('v1beta1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -3994,8 +4054,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4022,11 +4085,12 @@ describe('v1beta1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboards.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4040,8 +4104,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -4068,11 +4135,12 @@ describe('v1beta1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4086,8 +4154,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4105,11 +4176,12 @@ describe('v1beta1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboards.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4125,15 +4197,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4149,11 +4218,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardExperiments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperiments without error using callback', async () => { @@ -4166,15 +4238,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4207,11 +4276,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperiments with error', async () => { @@ -4224,15 +4296,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardExperiments = stubSimpleCall( undefined, @@ -4242,11 +4311,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.listTensorboardExperiments(request), expectedError ); - assert( - (client.innerApiCalls.listTensorboardExperiments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardExperiments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardExperimentsStream without error', async () => { @@ -4259,8 +4331,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4303,12 +4379,15 @@ describe('v1beta1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardExperiments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4322,8 +4401,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4355,12 +4438,15 @@ describe('v1beta1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardExperiments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4374,8 +4460,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4403,12 +4493,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4422,8 +4515,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardExperimentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardExperimentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4442,12 +4539,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardExperiments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4463,15 +4563,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -4487,11 +4583,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardRuns(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRuns without error using callback', async () => { @@ -4504,15 +4603,11 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -4545,11 +4640,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardRuns as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRuns with error', async () => { @@ -4562,26 +4660,25 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardRuns as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardRunsStream without error', async () => { @@ -4594,8 +4691,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -4633,11 +4733,12 @@ describe('v1beta1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4651,8 +4752,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4679,11 +4783,12 @@ describe('v1beta1.TensorboardServiceClient', () => { .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 + assert( + (client.descriptors.page.listTensorboardRuns.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4697,8 +4802,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -4725,11 +4833,12 @@ describe('v1beta1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4743,8 +4852,11 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardRunsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTensorboardRunsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4762,11 +4874,12 @@ describe('v1beta1.TensorboardServiceClient', () => { ).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 + assert( + (client.descriptors.page.listTensorboardRuns.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -4782,15 +4895,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -4806,11 +4916,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listTensorboardTimeSeries(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeries without error using callback', async () => { @@ -4823,15 +4936,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -4864,11 +4974,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeries with error', async () => { @@ -4881,15 +4994,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall( undefined, @@ -4899,11 +5009,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.listTensorboardTimeSeries(request), expectedError ); - assert( - (client.innerApiCalls.listTensorboardTimeSeries as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTensorboardTimeSeries as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTensorboardTimeSeriesStream without error', async () => { @@ -4916,8 +5029,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -4960,12 +5077,15 @@ describe('v1beta1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardTimeSeries, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -4979,8 +5099,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5012,12 +5136,15 @@ describe('v1beta1.TensorboardServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listTensorboardTimeSeries, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5031,8 +5158,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -5060,12 +5191,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5079,8 +5213,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTensorboardTimeSeriesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListTensorboardTimeSeriesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5099,12 +5237,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listTensorboardTimeSeries .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5120,15 +5261,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5144,11 +5282,14 @@ describe('v1beta1.TensorboardServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.exportTensorboardTimeSeriesData(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesData without error using callback', async () => { @@ -5161,15 +5302,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5202,11 +5340,14 @@ describe('v1beta1.TensorboardServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesData with error', async () => { @@ -5219,15 +5360,12 @@ describe('v1beta1.TensorboardServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -5237,11 +5375,14 @@ describe('v1beta1.TensorboardServiceClient', () => { client.exportTensorboardTimeSeriesData(request), expectedError ); - assert( - (client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportTensorboardTimeSeriesData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes exportTensorboardTimeSeriesDataStream without error', async () => { @@ -5254,8 +5395,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5301,12 +5446,15 @@ describe('v1beta1.TensorboardServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5320,8 +5468,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5356,12 +5508,15 @@ describe('v1beta1.TensorboardServiceClient', () => { request ) ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5375,8 +5530,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5404,12 +5563,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -5423,8 +5585,12 @@ describe('v1beta1.TensorboardServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExportTensorboardTimeSeriesDataRequest() ); - request.tensorboardTimeSeries = ''; - const expectedHeaderRequestParams = 'tensorboard_time_series='; + const defaultValue1 = getTypeDefaultValue( + 'ExportTensorboardTimeSeriesDataRequest', + ['tensorboardTimeSeries'] + ); + request.tensorboardTimeSeries = defaultValue1; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5443,12 +5609,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.exportTensorboardTimeSeriesData .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -5936,12 +6105,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -5973,12 +6145,15 @@ describe('v1beta1.TensorboardServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_vizier_service_v1.ts b/test/gapic_vizier_service_v1.ts index 5381fd6d..4d9f5dfc 100644 --- a/test/gapic_vizier_service_v1.ts +++ b/test/gapic_vizier_service_v1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy without error using callback', async () => { @@ -291,15 +305,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -322,11 +332,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy with error', async () => { @@ -338,26 +351,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy with closed client', async () => { @@ -369,7 +381,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateStudyRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createStudy(request), expectedError); @@ -386,26 +401,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy without error using callback', async () => { @@ -417,15 +429,9 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -448,11 +454,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy with error', async () => { @@ -464,23 +473,20 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy with closed client', async () => { @@ -492,7 +498,8 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetStudyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getStudy(request), expectedError); @@ -509,26 +516,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy without error using callback', async () => { @@ -540,15 +544,9 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -571,11 +569,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy with error', async () => { @@ -587,26 +588,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy with closed client', async () => { @@ -618,7 +616,8 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteStudyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteStudy(request), expectedError); @@ -635,26 +634,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy without error using callback', async () => { @@ -666,15 +664,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -697,11 +691,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy with error', async () => { @@ -713,26 +710,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy with closed client', async () => { @@ -744,7 +740,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LookupStudyRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.lookupStudy(request), expectedError); @@ -761,26 +760,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial without error using callback', async () => { @@ -792,15 +790,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -823,11 +817,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial with error', async () => { @@ -839,26 +836,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial with closed client', async () => { @@ -870,7 +866,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CreateTrialRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createTrial(request), expectedError); @@ -887,26 +886,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial without error using callback', async () => { @@ -918,15 +914,9 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -949,11 +939,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial with error', async () => { @@ -965,23 +958,20 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial with closed client', async () => { @@ -993,7 +983,8 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GetTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTrial(request), expectedError); @@ -1010,15 +1001,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1026,11 +1013,14 @@ describe('v1.VizierServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addTrialMeasurement(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement without error using callback', async () => { @@ -1042,15 +1032,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1073,11 +1059,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement with error', async () => { @@ -1089,26 +1078,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement with closed client', async () => { @@ -1120,7 +1108,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddTrialMeasurementRequest() ); - request.trialName = ''; + const defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addTrialMeasurement(request), expectedError); @@ -1137,26 +1128,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial without error using callback', async () => { @@ -1168,15 +1158,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1199,11 +1185,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial with error', async () => { @@ -1215,26 +1204,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial with closed client', async () => { @@ -1246,7 +1234,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CompleteTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.completeTrial(request), expectedError); @@ -1263,26 +1254,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial without error using callback', async () => { @@ -1294,15 +1282,9 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1325,11 +1307,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial with error', async () => { @@ -1341,26 +1326,23 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial with closed client', async () => { @@ -1372,7 +1354,8 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeleteTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteTrial(request), expectedError); @@ -1389,46 +1372,37 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); 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, - }, - }, - }; + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StopTrialRequest() + ); + const defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1451,11 +1425,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes stopTrial with error', async () => { @@ -1467,23 +1444,20 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes stopTrial with closed client', async () => { @@ -1495,7 +1469,8 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.StopTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.stopTrial(request), expectedError); @@ -1512,26 +1487,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials without error using callback', async () => { @@ -1543,15 +1517,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse() ); @@ -1574,11 +1544,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials with error', async () => { @@ -1590,26 +1563,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials with closed client', async () => { @@ -1621,7 +1593,10 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListOptimalTrialsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listOptimalTrials(request), expectedError); @@ -1638,15 +1613,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1655,11 +1626,14 @@ describe('v1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials without error using callback', async () => { @@ -1671,15 +1645,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1709,11 +1679,14 @@ describe('v1.VizierServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials with call error', async () => { @@ -1725,26 +1698,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials with LRO error', async () => { @@ -1756,15 +1728,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1773,11 +1741,14 @@ describe('v1.VizierServiceClient', () => { ); const [operation] = await client.suggestTrials(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkSuggestTrialsProgress without error', async () => { @@ -1832,15 +1803,12 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1849,11 +1817,14 @@ describe('v1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState without error using callback', async () => { @@ -1865,15 +1836,12 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1903,11 +1871,14 @@ describe('v1.VizierServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState with call error', async () => { @@ -1919,15 +1890,12 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -1937,11 +1905,14 @@ describe('v1.VizierServiceClient', () => { client.checkTrialEarlyStoppingState(request), expectedError ); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState with LRO error', async () => { @@ -1953,15 +1924,12 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -1970,11 +1938,14 @@ describe('v1.VizierServiceClient', () => { ); const [operation] = await client.checkTrialEarlyStoppingState(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { @@ -2030,15 +2001,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2047,11 +2014,14 @@ describe('v1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudies without error using callback', async () => { @@ -2063,15 +2033,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2096,11 +2062,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listStudies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudies with error', async () => { @@ -2112,26 +2081,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudiesStream without error', async () => { @@ -2143,8 +2111,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2175,11 +2146,12 @@ describe('v1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2192,8 +2164,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.createStream = stubPageStreamingCall( undefined, @@ -2221,11 +2196,12 @@ describe('v1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2238,8 +2214,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2259,11 +2238,12 @@ describe('v1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2276,8 +2256,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall( undefined, @@ -2296,11 +2279,12 @@ describe('v1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2315,15 +2299,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2332,11 +2312,14 @@ describe('v1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrials without error using callback', async () => { @@ -2348,15 +2331,11 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2381,11 +2360,14 @@ describe('v1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrials with error', async () => { @@ -2397,26 +2379,25 @@ describe('v1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrialsStream without error', async () => { @@ -2428,8 +2409,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2460,11 +2444,12 @@ describe('v1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2477,8 +2462,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.createStream = stubPageStreamingCall( undefined, @@ -2506,11 +2494,12 @@ describe('v1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2523,8 +2512,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2544,11 +2536,12 @@ describe('v1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2561,8 +2554,11 @@ describe('v1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall( undefined, @@ -2581,11 +2577,12 @@ describe('v1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3060,12 +3057,15 @@ describe('v1.VizierServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3096,12 +3096,15 @@ describe('v1.VizierServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_vizier_service_v1beta1.ts b/test/gapic_vizier_service_v1beta1.ts index b8fd4a73..2a7ca064 100644 --- a/test/gapic_vizier_service_v1beta1.ts +++ b/test/gapic_vizier_service_v1beta1.ts @@ -33,6 +33,21 @@ import { LocationProtos, } from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -260,26 +275,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy without error using callback', async () => { @@ -291,15 +305,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -322,11 +332,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy with error', async () => { @@ -338,26 +351,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createStudy with closed client', async () => { @@ -369,7 +381,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateStudyRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createStudy(request), expectedError); @@ -386,26 +401,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy without error using callback', async () => { @@ -417,15 +429,9 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -448,11 +454,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy with error', async () => { @@ -464,23 +473,20 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getStudy with closed client', async () => { @@ -492,7 +498,8 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetStudyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetStudyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getStudy(request), expectedError); @@ -509,26 +516,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy without error using callback', async () => { @@ -540,15 +544,9 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -571,11 +569,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy with error', async () => { @@ -587,26 +588,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteStudy with closed client', async () => { @@ -618,7 +616,8 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteStudyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteStudyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteStudy(request), expectedError); @@ -635,26 +634,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy without error using callback', async () => { @@ -666,15 +664,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -697,11 +691,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.lookupStudy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy with error', async () => { @@ -713,26 +710,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.lookupStudy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes lookupStudy with closed client', async () => { @@ -744,7 +740,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LookupStudyRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('LookupStudyRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.lookupStudy(request), expectedError); @@ -761,26 +760,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial without error using callback', async () => { @@ -792,15 +790,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -823,11 +817,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial with error', async () => { @@ -839,26 +836,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createTrial with closed client', async () => { @@ -870,7 +866,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CreateTrialRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateTrialRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createTrial(request), expectedError); @@ -887,26 +886,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial without error using callback', async () => { @@ -918,15 +914,9 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -949,11 +939,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial with error', async () => { @@ -965,23 +958,20 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getTrial with closed client', async () => { @@ -993,7 +983,8 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GetTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getTrial(request), expectedError); @@ -1010,15 +1001,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1026,11 +1013,14 @@ describe('v1beta1.VizierServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.addTrialMeasurement(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement without error using callback', async () => { @@ -1042,15 +1032,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1073,11 +1059,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addTrialMeasurement as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement with error', async () => { @@ -1089,26 +1078,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addTrialMeasurement as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addTrialMeasurement with closed client', async () => { @@ -1120,7 +1108,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddTrialMeasurementRequest() ); - request.trialName = ''; + const defaultValue1 = getTypeDefaultValue('AddTrialMeasurementRequest', [ + 'trialName', + ]); + request.trialName = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addTrialMeasurement(request), expectedError); @@ -1137,26 +1128,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial without error using callback', async () => { @@ -1168,15 +1158,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1199,11 +1185,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.completeTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial with error', async () => { @@ -1215,26 +1204,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.completeTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes completeTrial with closed client', async () => { @@ -1246,7 +1234,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CompleteTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('CompleteTrialRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.completeTrial(request), expectedError); @@ -1263,26 +1254,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial without error using callback', async () => { @@ -1294,15 +1282,9 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1325,11 +1307,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial with error', async () => { @@ -1341,26 +1326,23 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteTrial with closed client', async () => { @@ -1372,7 +1354,8 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeleteTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteTrial(request), expectedError); @@ -1389,46 +1372,37 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); 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, - }, - }, - }; + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest() + ); + const defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1451,11 +1425,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.stopTrial as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes stopTrial with error', async () => { @@ -1467,23 +1444,20 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopTrial as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes stopTrial with closed client', async () => { @@ -1495,7 +1469,8 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.StopTrialRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('StopTrialRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.stopTrial(request), expectedError); @@ -1512,26 +1487,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials without error using callback', async () => { @@ -1543,15 +1517,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse() ); @@ -1574,11 +1544,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listOptimalTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials with error', async () => { @@ -1590,26 +1563,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listOptimalTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listOptimalTrials with closed client', async () => { @@ -1621,7 +1593,10 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('ListOptimalTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.listOptimalTrials(request), expectedError); @@ -1638,15 +1613,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1655,11 +1626,14 @@ describe('v1beta1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials without error using callback', async () => { @@ -1671,15 +1645,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1709,11 +1679,14 @@ describe('v1beta1.VizierServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials with call error', async () => { @@ -1725,26 +1698,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes suggestTrials with LRO error', async () => { @@ -1756,15 +1728,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('SuggestTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1773,11 +1741,14 @@ describe('v1beta1.VizierServiceClient', () => { ); const [operation] = await client.suggestTrials(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.suggestTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.suggestTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkSuggestTrialsProgress without error', async () => { @@ -1832,15 +1803,12 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1849,11 +1817,14 @@ describe('v1beta1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState without error using callback', async () => { @@ -1865,15 +1836,12 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1903,11 +1871,14 @@ describe('v1beta1.VizierServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState with call error', async () => { @@ -1919,15 +1890,12 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -1937,11 +1905,14 @@ describe('v1beta1.VizierServiceClient', () => { client.checkTrialEarlyStoppingState(request), expectedError ); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkTrialEarlyStoppingState with LRO error', async () => { @@ -1953,15 +1924,12 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue( + 'CheckTrialEarlyStoppingStateRequest', + ['trialName'] + ); + request.trialName = defaultValue1; + const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -1970,11 +1938,14 @@ describe('v1beta1.VizierServiceClient', () => { ); const [operation] = await client.checkTrialEarlyStoppingState(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.checkTrialEarlyStoppingState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCheckTrialEarlyStoppingStateProgress without error', async () => { @@ -2030,15 +2001,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2053,11 +2020,14 @@ describe('v1beta1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudies without error using callback', async () => { @@ -2069,15 +2039,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2108,11 +2074,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listStudies as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudies with error', async () => { @@ -2124,26 +2093,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listStudies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listStudiesStream without error', async () => { @@ -2155,8 +2123,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2193,11 +2164,12 @@ describe('v1beta1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2210,8 +2182,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.createStream = stubPageStreamingCall( undefined, @@ -2239,11 +2214,12 @@ describe('v1beta1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listStudies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2256,8 +2232,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2283,11 +2262,12 @@ describe('v1beta1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2300,8 +2280,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListStudiesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListStudiesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall( undefined, @@ -2320,11 +2303,12 @@ describe('v1beta1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listStudies.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listStudies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2339,15 +2323,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2362,11 +2342,14 @@ describe('v1beta1.VizierServiceClient', () => { 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) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrials without error using callback', async () => { @@ -2378,15 +2361,11 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2417,11 +2396,14 @@ describe('v1beta1.VizierServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listTrials as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrials with error', async () => { @@ -2433,26 +2415,25 @@ describe('v1beta1.VizierServiceClient', () => { 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 defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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) - ); + const actualRequest = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listTrials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listTrialsStream without error', async () => { @@ -2464,8 +2445,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2502,11 +2486,12 @@ describe('v1beta1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2519,8 +2504,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.createStream = stubPageStreamingCall( undefined, @@ -2548,11 +2536,12 @@ describe('v1beta1.VizierServiceClient', () => { .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 + assert( + (client.descriptors.page.listTrials.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2565,8 +2554,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2592,11 +2584,12 @@ describe('v1beta1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2609,8 +2602,11 @@ describe('v1beta1.VizierServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListTrialsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListTrialsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall( undefined, @@ -2629,11 +2625,12 @@ describe('v1beta1.VizierServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listTrials.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listTrials.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -3108,12 +3105,15 @@ describe('v1beta1.VizierServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); it('uses async iteration with listLocations with error', async () => { @@ -3144,12 +3144,15 @@ describe('v1beta1.VizierServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.locationsClient.descriptors.page.listLocations .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); });
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_saved_queries.jsinclude:samples/generated/v1beta1/dataset_service.list_annotations.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.jsinclude:samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.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.write_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.upsert_datapoints.jsinclude:samples/generated/v1beta1/index_service.remove_datapoints.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.batch_import_model_evaluation_slices.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